Migrate Windows Server 2008 to a new hard disk 2

8,772

Solution 1

The bootmgr and BCD may have been on a different partition when you used imagex to make a backup. This is the default for Windows Server 2008 R2 and Windows 7; 2008 and Vista it depended on if you enabled BitLocker, and which direction the wind was blowing that day. When you booted WinPE did it show both a C: and a D: drive? If so, keep reading.

Unfortunately this is a possibility in Server 2008 that I didn't cover in my previous post, my apologies if this is the case. It's a somewhat easy fix at least:

  1. Pop the old drive back in the server, and use imagex to grab both the Boot Partition (C:) and the System Partition (D:) (you'll have to run it twice to get both partitions, don't write both to the same WIM file, the second time will just overwrite the first).

    imagex /capture C:\ Z:\MyServer-BootPartition.wim "MyServer"
    imagex /capture D:\ Z:\MyServer-SystemPartition.wim "MyServer"

  2. Pop the new drive into the server. Create partitions like so in diskpart

    sel drive 0
    clean
    create part pri size=100
    format quick
    act
    assign letter=c
    create part pri
    format quick
    assign letter=d
    exit

    Note: If you pick different letters than C and D above, substitute those letters in the following steps as well. The letters you assign in this step will not effect the letter assignment when windows boots, that's in the registry.

  3. Write the images to the drive partition (covered in the last post, but repeated here for clarity):

    imagex /apply Z:\MyServer-BootPartition.wim 1 C:\
    imagex /apply Z:\MyServer-SystemPartition.wim 1 D:\

  4. Modify the BCD for the new partitions.

    Run: bcdedit -store C:\boot\BCD -enum and take note of the "identifier" line in the "Windows Boot Loader" section. It's usually "{current}" or "{default}" but could be a GUID. Whatever it is, substitute that identifier where I put {current} in the 2nd and 3rd line below.

    bcdedit -store C:\boot\BCD -set {bootmgr} device partition=c:
    bcdedit -store C:\boot\BCD -set {current} device partition=d:
    bcdedit -store C:\boot\BCD -set {current} osdevice partition=d:

Solution 2

Unless the original disk is defective, I leave the old system disk in the server and just move the data to the new drive. Your server has room for spare disks, right?

In case you really must remove the old disk, your best bet is imaging software like Acronis Trueimage, Norton Ghost or similar.

In case the new disk uses a different controller than the old one (say IDE -> SATA), you have to install the new drivers etc first. With a little bit of tweaking, it should boot off the new disk. Read about boot.ini in this case.

After you did your backup, and tested it, you add the new disk to the server, and make a copy to the new disk. Then you remove the old disk and put it somewhere safe, make the new disk boot, and you are fine.

P.S. a dvd drive costs 15 bucks. Working around not having one is not cost effective. Just plug any old dvd into the server for as long as you need it.

The imaging path should be tested in a lab first, just to make sure you dont image the empty disk onto the full one.

Share:
8,772

Related videos on Youtube

Arseni Mourzenko
Author by

Arseni Mourzenko

Developer, architect, project manager, tester, and active DevOps supporter, I'm studying, observing and advising companies which have an important risk to fail their IT-related projects. I specialize in quality and productivity. After six years of freelancing, I worked for several companies, including Tata Con­sul­tan­cy Ser­vices. Today, I'm a happy member of Finaxys. I most­ly work with Lin­ux, Python, and Node.js, as well as the Mi­crosoft stack. Outside information technology, I'm interested by photography. I'm mostly active on SE.SE, and also maintain my blog. If you want to contact me, my email is [email protected]. Feel free to drop me a note about any de­vel­op­ment-re­lat­ed dis­cus­sions. If you live in Paris or want to vis­it Paris, you're very wel­come to con­tact me too.

Updated on September 17, 2022

Comments

  • Arseni Mourzenko
    Arseni Mourzenko over 1 year

    A few weeks ago, I already asked how to move a Windows Server 2008 to a new hard disk. Despite the previous answers and two weeks lost trying to do it, I am always unable to move the OS to the new drive.

    What I tried:

    • A backup/restore using Windows Backup. This never helped.

      1. First, I tried to backup, then copy the backup to a new drive, then restore. This results in "The parameter is incorrect. (0x80070057)" error caused by a bug in Windows Backup.
        • Recently, I attempted to backup to a network share, but I can't restore from it, because of a "*The network path was not found. (0x80070035)" error. Trying the netsh interface ipv4 set address [...] does not work neither (saw at least three different errors, mostly "The interface is unknown.") Solved, but then I have "The parameter is incorrect." error which I have even after removing all old backups, clearing all logs and doing a new full backup.
    • A previously suggested solution using imagex from Windows AIK results in a non-bootable disk after writing an image to it. When booting from Windows 2008 installation disk (from USB), it finds that the HDD is not bootable and proposes to fix this, but then crashes, resulting in an unbootable USB flash disk (and HDD stays unbootable).

    • As I said in my previous question, doing a clone of a hard disk drive gives an (of course) bootable disk, but Windows complain about hardware changes and cannot start.

    Now can somebody suggest me another way to move Windows Server 2008 to a new hard disk? Is it at least possible to do, or any hard disk failure/change implements necessarily to reinstall the whole OS?

  • Posipiet
    Posipiet about 14 years
    The mirroring way requires a change to the existing drive, which is a potential threat to data. Therefore, while this might work, it is a last ditch effort (yes, I used it with success in the past).
  • Jason Berg
    Jason Berg about 14 years
    I only recommended it because of his previous problems with imaging. I agree, last ditch effort. I also want to re-stress the importance of a lab test first.
  • Philip
    Philip over 8 years
    @user1914380 The post specifically says that the identifier is ususally not a GUID. Please use the identifier reported by bcdedit and do not substitute. Thank you!