Manually Migrate Virtual Machines From One Hyper-V Host to Another

Printer-friendly versionPDF version
Hyper-V

Typically, migrating a virtual machine from one Hyper-V host to another would involve System Center Virtual Machine Manager, however, if you do not have that software or do not want to use it, you can follow this guide to move virtual machines manually. The drawback to moving the virtual machines manually is the machine has to be powered off. The total amount of downtime depends on the size of the virtual machine.

Begin by shutting off the desired VM. Open the Hyper-V manager at Start > Administrative Tools > Hyper-V Manager, right click on the desired VM and choose Shut Down:

Hyper-V1

Now right click on the VM and choose Export:

Hyper-V2

Choose any folder to export the VM to (whatever folder you select, a sub-folder will be created with the name of the VM and all of the data files will be stored there). Depending on the size of the VM, this could take anywhere from 10 minutes to several hours:

Hyper-V3

After the VM exports, you will need to copy the exported folder to the new Hyper-V host. It does not matter what folder you copy it to, but it will be a permanent location, so choose it wisely. I chose to put my VM's in C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines. 

Hyper-V4

On the new Hyper-V host, you will need to import the VM. Open the Hyper-V Manager, right click on the Hyper-V host, and choose Import Virtual Machine:

Hyper-V5

Browse to the sub-folder where your VM is located and click Select Folder:

Hyper-V6

You can choose one of the following:

  • Move or restore the virtual machine (use the existing unique ID)
  • Copy the virtual machine (create a new unique ID)

Note: If you choose move, you do not need to use the old virtual machine anymore, as the GUID will be the same.

Hyper-V7

Wait patiently while the VM imports (This is much quicker than exporting. It's almost instant):

Hyper-V8

After it completes successfully, all you have to do is power on the VM and you are ready to go. Unfortunately, the import process does not always complete successfully. Some of the most common errors you may experience usually involve the network cards.

Hyper-V9

If you get a message like this, check the Hyper-V-VMMS event log. If the hosts NIC's do not match, you will likely get an error like this:

  • Event ID 18330 - Virtual network switch name was not found (Local Area Connection 2 - Virtual Network Adapter). Network adapter will be disconnected from the network.
  • Event ID 18320 - Import failed to configure network connection for network card. You must modify the connection of all affected network adapters to be able to run the virtual machine. If you imported snapshots and apply any of those snapshots after modifying the connection, you must modify the connection again to be able to run the virtual machine.

Hyper-V10

To fix this, simply assign the VM to the correct network adapter on the new host. While the VM is powered off, right click it and choose settings:

Hyper-V11

Select Network Adapter from the Hardware list (notice it says "Not connected") and choose the appropriate Network from the drop down menu:

Hyper-V12

You should now be able to start the VM with no problems. Make sure you either delete the old VM or set it to not start with the host so it doesn't accidently get turned back on after moving the VM to the new host.

Post new comment