Introduction: Windows OS Migration Basics
In this Windows OS migration guide, you will learn how to transfer your Windows OS to another server.
To begin, it’s crucial to grasp that you can successfully migrate Windows OS only if it’s installed on the base disc.
All operations with the Windows mirror must occur within the installed OS.
In order to perform OS migration to a new server, you need a KVM-over-IP access or the ability to boot the server into rescue mode to speed up the whole procedure.
Preparation for Migration
In this example, we will consider the migration using rescue mode + QEMU
Step-by-Step Windows OS migration guide
1. In the installed OS, we make sure that the mirror has a “Healthy” tag and has not fallen apart:
2. Disassemble the mirror (do not remove it):
3. Check if nothing is broken by rebooting, if everything is OK (as it should be), then go on, otherwise think about what went wrong and restore the boot.
4. Following this, in the booted system, navigate to disk management and identify the physical disc from which you booted (typically labeled with a ‘C:’ partition). Avoid any modifications to it and proceed to work with the second physical disc:
We will need a place to put the backup, so if the amount of data on the disc allows us to put it in the remaining free space, we can use it. Otherwise, we will need to mount external storage as a network drive and save the backup there. Let’s consider the case when we are lucky and have free space on the disc, then working with the second physical disc we cut off the necessary space from the former mirror partition and create another partition:
This approach will allow us to keep a working copy of the data on the second disc in case something goes wrong when converting the first disc from dynamic to basic and the data on it is lost.
5. Loading the server into rescue mode.
6. Check if QEMU is installed in the rescue mode, install if necessary.
7. Download Hiren’s BootCD PE image, with which we will work with the drives and backups:
and an image with drivers in case the drives will not be displayed in the virtual machine:
8. When everything is ready, start the virtual machine with QEMU:
qemu-system-x86_64 \ -enable-kvm \ -name Windows \ -M q35 \ -m 8092 \ -cpu host \ -smp 4 \ -device VGA,edid=on,xres=1280,yres=720 \ -device ahci,id=ahci \ -drive id=disk,file=/dev/sda,if=none,format=raw -device ide-hd,drive=disk,bus=ahci.0 \ -drive id=disk2,file=/dev/sdb,if=none,format=raw -device ide-hd,drive=disk2,bus=ahci.1 \ -drive id=virtio_cd,file=virtio-win.iso,if=none,format=raw,media=cdrom -device ide-cd,drive=virtio_cd,bus=ahci.2 \ -cdrom HBCD_PE_x64.iso \ -k en-us \ -vnc $IP_ADDRESS:17 \ -monitor stdio \ -device usb-ehci,id=usb \ -device usb-tablet \ -boot d
Performing Backup and Recovery
9. The above command will start the virtual machine and boot it from the HBCD_PE_x64.iso image. The VM interface can be accessed by any VNC client using the server IP address on port 5917 (IP:17).
10. Boot into Hiren’s BootCD PE and run EaseUS Partition Master:
At this stage, you may receive a message that no discs were found. In this case, you should install the drivers, which can be found on the pre-mounted virtio-win.iso disc.
11. Convert the disc (which we originally defined as the one we will work with in step 4) from dynamic to basic:
12. Now, it is very desirable to check if the server is still functional by rebooting. To do this, terminate the QEMU virtual machine and start it again, only without the second disc and CD-ROMs, leaving in the configuration only the disc converted to basic (don’t forget to replace the /dev/sda device with the appropriate one for your situation):
qemu-system-x86_64 \ -enable-kvm \ -name Windows \ -M q35 \ -m 8092 \ -cpu host \ -smp 4 \ -device VGA,edid=on,xres=1280,yres=720 \ -device ahci,id=ahci \ -drive id=disk,file=/dev/sda,if=none,format=raw -device ide-hd,drive=disk,bus=ahci.0 \ -k en-us \ -vnc $IP_ADDRESS:17 \ -monitor stdio \ -device usb-ehci,id=usb \ -device usb-tablet
13. If everything is OK (and it should be), stop the VM again and start the previous configuration (step 8), boot into Hiren’s BootCD PE and open the Macrium Reflect PE application:
Select Disc Backup:
Specify the location where the copy will be stored (in this case it is the partition we created in step 4 using the free space on the second disc):
Then click Next and Finish. This will start the backup process.
Restoring the OS
14. After the backup has been created, power down the VM and mount the partition containing the backup to /mnt to be able to copy the backup to the target (new) server:
15. On the target server, you must also download the Hiren’s BootCD PE image and boot the QEMU virtual machine from it. You need to create a partition on one of the discs:
which you then mount to /mnt:
and copy the backup from the source server to it:
16. Start the QEMU virtual machine on the target server again and boot into Hiren’s BootCD PE, we now have a backup from which we will restore the OS to the second drive using the same Macrium Reflect PE:
Click Next and then Finish.
17. After the message about successful recovery, reboot the server, and it should boot into the installed OS. The first boot may take longer than usual, as drivers for the new hardware are being installed.
18. Next, configure the network, if necessary, and restore the mirror in the Disk Manager:
Checking all other functionality.