Read on:

Beginners’ Guide for Microsoft Hyper-V: Overview of Hyper-V – Part 1
Beginners’ Guide for Microsoft Hyper-V: How to Install Microsoft Hyper-V Using Server Manager – Part 2
Beginners’ Guide for Microsoft Hyper-V: How to Install Microsoft Hyper-V with PowerShell – Part 3
Read More

Introduction

In working with Hyper-V environments, there will undoubtedly be times when you will need to take a Hyper-V virtual machine from one Hyper-V server and move it to another Hyper-V server or cluster. Or, you may want to export a Hyper-V virtual machine to archive the virtual machine for later or historical purposes. Hyper-V can export virtual machines as part of the built-in functionality in Hyper-V Manager. Let’s take a look at how to export Hyper-V virtual machines for beginners and see how this is accomplished step-by-step.

Protect Your Data with BDRSuite

Cost-Effective Backup Solution for VMs, Servers, Endpoints, Cloud VMs & SaaS applications. Supports On-Premise, Remote, Hybrid and Cloud Backup, including Disaster Recovery, Ransomware Defense & more!

Why export or import a Hyper-V virtual machine?

Exporting a Hyper-V virtual machine and then importing it is a great way to move a virtual machine between two Hyper-V environments. It is also a way to create a copy of a virtual machine. There may be a need to export and import a virtual machine from a standalone Hyper-V server to a Hyper-V cluster or vice versa.

For Hyper-V environments with limited network connectivity or low bandwidth between sites, you can easily export a virtual machine from one environment and then import the virtual machine. For example, Hyper-V admins can export VM files to removable storage and then copy the files from the removable storage to the target Hyper-V environment.

It could also be a viable means of creating a lab or test environment by exporting production Hyper-V virtual machines from your production environment and importing them into your lab or test environment.

Download Banner

Is it the same as a Hyper-V checkpoint (snapshot)?

The checkpoint in Hyper-V is the term used in Hyper-V for snapshots in other hypervisors like VMware vSphere. Hyper-V checkpoints allow taking quick point-in-time images of Hyper-V virtual machines so these can be returned to this state, including the memory footprint (with non-production checkpoints).

Remember that a Hyper-V checkpoint is not a complete representation of the Hyper-V virtual machine. So, for example, the data would not be complete if you were to copy only the checkpoint and not the underlying base virtual disks. The files and data included in a Hyper-V export are a full copy of the Hyper-V virtual machine. It does not rely on additional files still present on the source Hyper-V environment for the source virtual machine.

What is included in a Hyper-V virtual machine export?

The export of the Hyper-V virtual machine contains all files needed to restore the virtual machine in a different environment completely. The exported files include all the Hyper-V virtual machine virtual hard disks, VM configuration files, and Hyper-V checkpoint files in the bundle.

When you perform an export of a Hyper-V virtual machine, you will see the following three folders created in the export directory:

  • Snapshots
  • Virtual Hard Disks
  • Virtual Machines

Export-and-Import-Hyper-V

Folders created in a Hyper-V export of a virtual machine

Export a Hyper-V virtual machine using Hyper-V Manager

Let’s first look at exporting a Hyper-V virtual machine using Hyper-V Manager. The export functionality is found in the Hyper-V Manager console. When you right-click on a Hyper-V virtual machine, you will see the option to Export.

Export-and-Import-Hyper-V

Beginning the process of exporting a Hyper-V virtual machine

It will launch the Export Virtual Machine dialog box. Click the Browse button. We need to choose the location where the Hyper-V virtual machine export will be located.

Export-and-Import-Hyper-V

Browse to the location where you want to store the exported Hyper-V virtual machine

After choosing the location for the Hyper-V virtual machine, this will be populated in the dialog box. Click the Export button. It will kickoff the process of exporting the Hyper-V virtual machine.

Export-and-Import-Hyper-V

After choosing the Hyper-V export location

After clicking Export, you will see the status Exporting – succeeded once the export has finished successfully.

Export-and-Import-Hyper-V

The Hyper-V virtual machine export process completes successfully

Import a Hyper-V virtual machine using Hyper-V Manager

Once the Hyper-V virtual machine has been exported from a Hyper-V Server, the files are a complete copy that can be imported into another Hyper-V server running in the environment. Right-click on the Hyper-V host and select the Import Virtual Machine option.

Export-and-Import-Hyper-V

Importing a Hyper-V virtual machine using Hyper-V Manager

It will launch the Import Virtual Machine wizard. Click Next.

Export-and-Import-Hyper-V

Launching the Export Virtual Machine wizard

Select the folder you copied from the export operation on the other Hyper-V host. Click Next.

Export-and-Import-Hyper-V

Select the Hyper-V virtual machine to import

Select the Hyper-V virtual machine listed. Click Next.

Export-and-Import-Hyper-V

Selecting the listed Hyper-V virtual machine for import

Next, you choose the type of import to perform:

  • Register the virtual machine in-place (use the existing unique ID)
  • RRestore the virtual machine (use the existing unique ID)
  • RCopy the virtual machine (create a new unique ID)

Export-and-Import-Hyper-V

Choose the type of import to perform

You will likely see an error regarding the Hyper-V virtual switch the VM was originally connected to. You can choose the target Hyper-V virtual switch on the new Hyper-V host.

Export-and-Import-Hyper-V

Select the Hyper-V virtual switch on the target Hyper-V host

Review the summary screen on the Import Virtual Machine wizard. Click Finish.

Export-and-Import-Hyper-V

Review the Import wizard configuration settings

After clicking Finish, the Hyper-V virtual machine should be registered on the new Hyper-V host.

Export-and-Import-Hyper-V

The imported Hyper-V virtual machine is successfully registered on the new Hyper-V host

Using PowerShell to Export and Import Hyper-V VMs

A couple of cmdlets allow you to export and import Hyper-V virtual machines from one host to the other.

  • Export-VM
  • Import-VM

Export-VM

[-CimSession ]
[-ComputerName ]
[-Credential ]
[-Name]
[-Path]
[-AsJob]
[-Passthru]
[-CaptureLiveState ]
[-WhatIf]
[-Confirm]
[]

Export-and-Import-Hyper-V

Exporting a Hyper-V virtual machine using PowerShell

Import-VM

[-CimSession ]
[-ComputerName ]
[-Credential ]
[-Path]
[-Register]
[-AsJob]
[-WhatIf]
[-Confirm]
[]

Export-and-Import-Hyper-V

Importing a Hyper-V virtual machine using PowerShell

Wrapping Up

The process of exporting and importing a Hyper-V virtual machine is a great way to move or copy a virtual machine from one Hyper-V server to another Hyper-V environment. The Export process takes a complete copy of the Hyper-V virtual machine, including virtual disks, configuration files, and checkpoints.
Using the Hyper-V Manager makes this process a very wizardized experience, allowing administrators to easily choose the virtual machine and export the machine for re-importing into a separate Hyper-V environment. Importing the Hyper-V virtual machine is seamless as the wizard steps you through the process to import the virtual machine copied from the original Hyper-V environment. In addition, PowerShell makes this process easy for bulk exports and import operations, allowing administrators to script these operations.

Follow our Twitter and Facebook feeds for new releases, updates, insightful posts and more.


Beginners Guide for Microsoft Hyper-V: How to Install Microsoft Hyper-V in Windows Server Core – Part 4
Beginners Guide for Microsoft Hyper-V: Remote Management of Hyper-V – Part 5
Beginners Guide for Microsoft Hyper-V: How to Install Hyper-V Server – Part 6
Beginner’s Guide for Microsoft Hyper-V: What is Azure Stack HCI – Part 7
Beginner’s Guide for Microsoft Hyper-V: Windows Admin Center Hyper-V Management – Part 8
Beginner’s Guide for Microsoft Hyper-V: Configuration of Hyper-V Networking Best Practices – Part 9
Beginner’s Guide for Microsoft Hyper-V: Hyper-V Storage Best Practices and Configuration – Part 10
Beginner’s Guide for Microsoft Hyper-V: How to build a Virtual Lab with Hyper-V – Part 11
Beginner’s Guide for Microsoft Hyper-V: Top 10 PowerShell Commands for Hyper-V – Part 12
Beginner’s Guide for Microsoft Hyper-V: How to Create a Hyper-V Virtual Machine – Part 13
Beginner’s Guide for Microsoft Hyper-V: Hyper-V Shared Storage for Beginners – Part 14
Beginner’s Guide for Microsoft Hyper-V: How to Create Hyper-V Cluster – Part 15
Beginner’s Guide for Microsoft Hyper-V: What is Non-Uniform Memory Access (NUMA) – Part 16
Beginner’s Guide for Microsoft Hyper-V: Hyper-V Dynamic Memory – Part 17
Beginner’s Guide for Microsoft Hyper-V: Cluster Aware Updating (CAU) – Part 18
Beginner’s Guide for Microsoft Hyper-V: Hyper-V Containers – Part 19
Beginner’s Guide for Microsoft Hyper-V: Managing Windows Server Containers with Windows Admin Center – Part 20
Beginner’s Guide for Microsoft Hyper-V: What are Hyper-V Checkpoints – Part 21
Beginners Guide for Microsoft Hyper-V: How to Create Cluster Shared Volumes (CSVs) – Part 22
Beginners’ Guide for Microsoft Hyper-V: VHD vs VHDX Vs AVHD/AVHDX: Overview of Virtual Disk Formats – Part 23
Beginners’ Guide for Microsoft Hyper-V: Hyper-V Live Migration – Part 24
Beginners’ Guide for Microsoft Hyper-V: Hyper-V High Availability – Part 25

Rate this post