Emergency server help: get in touch

Hyper-V Export and Import VM: Move VMs with PowerShell

Export, import and move Hyper-V VMs with PowerShell: Export-VM, Compare-VM fixes, Import-VM -Copy -GenerateNewId, and Move-VM with Kerberos on Windows Server 2025.

Published 9 min read

Short answer: To move or copy a Hyper-V VM, export it with Export-VM -Name APP01 -Path E:\Export, copy the folder to the new host, run Compare-VM against the .vmcx file to find incompatibilities (missing switch, too-new configuration version), then import with Import-VM -Path <file.vmcx> -Copy -GenerateNewId for a clone or -Copy alone for a move. Between domain-joined hosts you can skip the export and use Move-VM -IncludeStorage, but on Windows Server 2025 that needs Kerberos constrained delegation because CredSSP-based live migration no longer works there by default.

Applies to Hyper-V on Windows Server 2019, 2022 and 2025

Commands checked against the official documentation (linked below) on 6 October 2026; not yet run on our lab servers.

Choose the right method

MethodDowntimeWhen to use it
Export-VM + Import-VMNone for the export; the VM is offline only while you cut overHosts in different domains or workgroups, moving through a USB disk or NAS, keeping an offline copy, cloning a lab VM
Move-VM -IncludeStorage (shared-nothing live migration)None, if live migration is set upDomain-joined hosts on the same network, routine host maintenance
Move-VMStorageNoneSame host, files to a new volume
Register in place with Import-VMVM must be offRebuilt or reinstalled host where the VM files are still on disk

Whatever the method, the destination host must support the VM’s configuration version. You can move a VM from an older Hyper-V host to a newer one, not the other way round. On Windows Server 2025, new VMs are version 12.0; Server 2022 supports up to 10.0 and Server 2019 up to 9.0. Check both sides:

Get-VM APP01 | Select-Object Name, Version, Generation, State
Get-VMHostSupportedVersion -ComputerName HV02

Export a VM

Export collects the configuration, every virtual disk and any checkpoints into one folder. It works on a running VM. Make sure the target volume has free space at least equal to the VM’s disk files.

Export-VM -Name APP01 -Path 'E:\Export'

# Several VMs at once; each gets its own sub-folder
Get-VM -Name 'APP*' | Export-VM -Path 'E:\Export' 

For a running VM, -CaptureLiveState controls what is captured:

  • CaptureSavedState includes the memory state, so the imported VM resumes where it was.
  • CaptureDataConsistentState uses production checkpoint technology (VSS inside the guest) for an application-consistent copy without memory.
  • CaptureCrashConsistentState does nothing special, which equals pulling the power cord on the copy.
Export-VM -Name APP01 -Path 'E:\Export' -CaptureLiveState CaptureDataConsistentState

Exports with -AsJob run in the background; check them with Get-Job. In Hyper-V Manager, right-click the VM > Export, and follow progress in the Status column.

Merge or delete old checkpoints before a planned move. Every checkpoint is exported as an AVHDX chain, which makes the copy bigger and slower, and a broken chain will break the import too. See Hyper-V checkpoint merge failed.

Check compatibility with Compare-VM before importing

Copy the export folder to the new host, then find the configuration file. Its name is the VM’s GUID:

$vmcx = Get-ChildItem 'E:\Export\APP01' -Recurse -Filter '*.vmcx' | Select-Object -First 1 -ExpandProperty FullName

Generate a compatibility report for the import type you plan to use. The report lists every problem without changing anything:

$report = Compare-VM -Path $vmcx -Copy -GenerateNewId
$report.Incompatibilities | Format-Table Message, MessageId, Source -AutoSize

The most common finding is a virtual switch that does not exist on the new host. Microsoft’s own example shows it as Could not find Ethernet switch 'Production'. with MessageId 33012. Fix it in the report, not on the source host:

# Option A: connect the adapter to a switch that exists here
$report.Incompatibilities |
    Where-Object MessageId -eq 33012 |
    ForEach-Object { $_.Source | Connect-VMNetworkAdapter -SwitchName 'External-LAN' }

# Option B: just disconnect it and fix networking after import
# $report.Incompatibilities[0].Source | Disconnect-VMNetworkAdapter

# Re-check: Incompatibilities should now be empty
$report = Compare-VM -CompatibilityReport $report
$report.Incompatibilities

Other incompatibilities you may see: more vCPUs or more startup memory than the new host has (fix with Set-VMProcessor or Set-VMMemory on $report.VM), an ISO path in the DVD drive that does not exist, and a configuration version the host does not support. That last one cannot be fixed in the report: you need a newer host, or create a new VM of the same generation on the older host and attach the existing VHDX.

Import the VM

There are three import types. Pick based on whether you want the files copied and whether the VM keeps its ID:

Import typePowerShellFilesVM ID
Register in placeImport-VM -Path $vmcxUsed where they areSame
RestoreImport-VM -Path $vmcx -Copy -VirtualMachinePath … -VhdDestinationPath …Copied to the paths you chooseSame
CopyImport-VM -Path $vmcx -Copy -GenerateNewIdCopied (default host paths unless you add the path parameters)New

Moving a VM to a new host: use Restore (keep the ID, copy files to their final location). If the same VM ID is still registered on this host, Hyper-V refuses the import until the old one is removed.

Import-VM -Path $vmcx -Copy `
    -VirtualMachinePath 'D:\Hyper-V' `
    -VhdDestinationPath 'D:\Hyper-V\Virtual Hard Disks\APP01' `
    -SnapshotFilePath 'D:\Hyper-V' -SmartPagingFilePath 'D:\Hyper-V' 

Cloning a VM (a lab template, a test copy of production): use Copy with -GenerateNewId, so the new VM can sit next to the original on the same host.

Import-VM -Path $vmcx -Copy -GenerateNewId -VhdDestinationPath 'D:\Hyper-V\Virtual Hard Disks\APP01-TEST'

If you fixed incompatibilities in a report, import from the report so the fixes apply:

Import-VM -CompatibilityReport $report

A cloned Windows VM has the same computer name, SID and (inside the guest) the same static IP as the original. Keep the clone on an isolated or private switch until you have renamed it, changed its IP, and, if it will join a domain alongside the original, generalized it with Sysprep. Never start a cloned domain controller on the production network.

Then rename the clone in Hyper-V so the two are not confused: Get-VM -Id <new-guid> | Rename-VM -NewName APP01-TEST.

Move a running VM with Move-VM

Shared-nothing live migration moves the running VM and its storage between two hosts in the same domain with no downtime. Set it up once on both hosts:

Enable-VMMigration
Add-VMMigrationNetwork 192.168.10.0/24          # a dedicated migration subnet
Set-VMHost -UseAnyNetworkForMigration $false     # use only the networks you added
Set-VMHost -VirtualMachineMigrationAuthenticationType Kerberos

With Kerberos you must configure constrained delegation in Active Directory: on each host’s computer account (Delegation tab in Active Directory Users and Computers), trust it for delegation to the other host for the cifs and Microsoft Virtual System Migration Service services. This needs Domain Admin rights.

Windows Server 2025 enables Credential Guard by default on domain-joined servers that are not domain controllers. As a result, CredSSP-based live migration (the default on Server 2022 and earlier) stops working after you upgrade hosts to 2025. Microsoft’s fix is to switch to Kerberos with constrained delegation as shown above.

Then move the VM and all of its files in one step:

Move-VM -Name APP01 -DestinationHost HV02 -IncludeStorage -DestinationStoragePath 'D:\Hyper-V\APP01'

If the two hosts have different CPU generations from the same vendor, the move may be blocked by processor feature differences. Shut the VM down once and run Set-VMProcessor -VMName APP01 -CompatibilityForMigrationEnabled $true. Moving live between Intel and AMD hosts is not possible; use export and import.

You can test a move first: Compare-VM -Name APP01 -DestinationHost HV02 -IncludeStorage -DestinationStoragePath D:\Hyper-V\APP01 returns the same kind of report as for an import.

To move only the files on the same host (for example, off a full volume), use Move-VMStorage -VMName APP01 -DestinationStoragePath E:\Hyper-V\APP01.

Check that it worked

Get-VM APP01 | Select-Object Name, State, Status, Version, Path, Id
Get-VMHardDiskDrive -VMName APP01 | Select-Object Path
Get-VMNetworkAdapter -VMName APP01 | Select-Object SwitchName, MacAddress, DynamicMacAddressEnabled, IPAddresses
Get-VMSnapshot -VMName APP01

Check that disk paths point to the new host’s storage (not a UNC path back to the old one), the network adapter is on the right switch, the guest gets its expected IP, and any checkpoints you exported came across. Start the VM, log in, and test the application before you delete anything on the source.

Only after that, remove the source VM and its files. Remove-VM unregisters the VM but leaves its disk files, so delete those separately once you are sure:

Remove-VM -Name APP01 -ComputerName HV01 -WhatIf   # drop -WhatIf when you have confirmed the target

Common problems

  • “Unable to import virtual machine due to configuration errors. Please use Compare-VM to repair the virtual machine.” Run Compare-VM as shown above, fix each incompatibility in the report, then Import-VM -CompatibilityReport $report.
  • The VM’s configuration version is not supported. You are importing a VM from a newer host into an older one. There is no downgrade; create a new VM on the older host and attach the VHDX.
  • Import fails with “The process cannot access the file because it is being used by another process. (0x80070020)”. Something (antivirus, a backup agent, an open Explorer copy) has the files open. Find and stop it, then retry.
  • Import says the VM already exists. You used register-in-place or restore on a host where that VM ID is still registered. Remove the stale entry or import with -Copy -GenerateNewId.
  • Live migration fails with an authentication error after a Server 2025 upgrade. CredSSP plus Credential Guard; move to Kerberos with constrained delegation.
  • Duplicate MAC address warnings after cloning. The source used a static MAC. Set the clone to a new MAC or dynamic MAC with Set-VMNetworkAdapter -VMName APP01-TEST -DynamicMacAddress.

Official documentation: Export and import virtual machines · Compare-VM · Set up hosts for live migration without failover clustering · Supported VM configuration versions

Related: Migrate VMware to Proxmox VE 9: Steps After Broadcom · P2V Windows Server to VMware 2026: Reliable Conversion Steps · Windows Server 2025 In-Place Upgrade: Safe Steps from 2012 R2 to 2022 · Change Domain Controller IP Address Safely · Install Proxmox VE 9: Step-by-Step Setup on Bare Metal

See also: Install Hyper-V on Windows Server 2025: Switches and First VM · Hyper-V Checkpoint Merge Failed: Fix Stuck AVHDX Chains Safely

Frequently asked questions

Can I export a running Hyper-V VM?

Yes. Export-VM works on running VMs. Use -CaptureLiveState to choose between saved state (with memory), data-consistent (production checkpoint) or crash-consistent copies.

What is the difference between Restore and Copy when importing?

Both copy the files to a location you choose. Restore keeps the original VM ID, so it is for moving a VM. Copy with -GenerateNewId gives it a new ID, so it is for cloning.

Can I import a Server 2025 VM into Windows Server 2022 Hyper-V?

Not if it uses configuration version 12.0 or 11.0. Server 2022 supports up to version 10.0. Create the VM on 2025 with New-VM -Version 10.0 if it must be able to move back, or rebuild it on the older host using the existing VHDX.

Do I need to export to move a VM between two Hyper-V hosts?

No, if both are in the same domain and live migration is configured: Move-VM -IncludeStorage moves the running VM and its files. Export and import is for everything else.

Does Import-VM copy the disks?

Only with -Copy. Without it, the VM is registered in place and runs from the files where they are now.

Maintenance record

This guide changes servers, data or security settings, so we re-check it against current versions on a fixed schedule. Take a backup or snapshot before you start.

Maintained by
srvScripts editorial team
Supported versions
Hyper-V on Windows Server 2019, 2022 and 2025
Last full review
Next review

Free website test

Is your website set up right?

Check SSL, security headers, redirects, robots.txt, sitemap, llms.txt and security.txt in one test. It takes about 30 seconds.