---
title: "Import & Export OVF Files: Move VMs Between Hosts"
description: "Learn how to import and export OVF files to move virtual machines between hosts in this informative tutorial."
canonical: "https://adamtheautomator.com/ovf-file/"
---

# Import & Export OVF Files: Move VMs Between Hosts

> Learn how to import and export OVF files to move virtual machines between hosts in this informative tutorial.

Source: https://adamtheautomator.com/ovf-file/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Import & Export OVF Files: Move VMs Between Hosts](https://adamtheautomator.com/wp-content/uploads/2019/07/VMware_logo.svg_.png)

# Import & Export OVF Files: Move VMs Between Hosts

[![](https://secure.gravatar.com/avatar/4147968aa2332aa682bcebf295e4e9d0eb2672dee3d9ae0523a00ac51e7d6017?s=192&d=mm&r=g)Bill Kindle](https://adamtheautomator.com/author/bill/)26 July 20193 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[PowerShell](/tag/powershell/)[VmWare](/tag/vmware/)

Table of Contents

*   [Connecting to vCenter](#connecting-to-vcenter)
*   [Exporting VMs to an OVF File](#exporting-to-an-ovf-file)
*   [Importing OVF Files](#importing-the-ovf-file)
*   [Summary](#summary)

In my current day job, I’m often asked about using PowerCLI to perform a number of tasks in a vCenter cluster. In this post, I’ll share how I learned how to an import OVF file in VMware.

![OVF File](https://adamtheautomator.com/wp-content/uploads/2022/03/How-to-Import-and-Export-an-OVF-file-in-VMware-with-PowerShell-1024x576.jpg)

OVF File

This is a story about a recent request for assistance from a colleague who needed to export a custom monitoring appliance template to a new vCenter cluster that was being built. My colleague was under a time constraint and did not have the necessary access to the template.

If you don’t already, be sure to download the [PowerCLI](https://adamtheautomator.com/powercli-tutorial/ "PowerCLI") module via `Install-Module -Name PowerCLI`

## Connecting to vCenter

Never wanting to miss a chance to use [PowerShell](https://adamtheautomator.com/tag/powershell/) or PowerCLI, I jumped in head first to help. I gathered the necessary information from my colleague, and began connecting to the cluster:

```powershell
PS6> Connect-VIServer -Server vcenter.mydomain.local -Credential (Get-Credential)
```

This takes just a moment to complete. Once you’ve connected, you need to know what verbs to use. You can do this using the `Get-Command -Module PowerCLI` cmdlet.

There are two cmdlets that stand out:

*   `Export-VApp`
*   `Import-VApp`

Both of these cmdlets appear to be exactly what you need. But first, since this is a learning experience for me and maybe you, I’ll educate myself a little more on the proper use for each.

## Exporting VMs to an OVF File

The `Export-VApp` cmdlet will export the powered off VM as an OVF to the current directory you session is in by default if you do not specify a path.

I already have a path in mind so I’m going to be using the _C:\\Exported-OVF_ directory but yours may vary. Knowing this, you can then run `Export-VApp` against the VM template specifying the destination folder.

```powershell
PS6> Export-VApp -VM 'My_VM_Template' -Destination 'C:\Exported-OVF\'
```

But there’s an issue. You cannot export a running VM to an OVF. No worries, this is a quick fix. Modify your code a little more and be sure to first shut down the VM using the `Shutdown-VMGuest` cmdlet.

```powershell
PS6> Shutdown-VMGuest -VM 'My_VM_Template'
```

With the template appliance now offline, resume running the `Export-VApp` cmdlet attempted earlier. This process will take a few minutes, and wasn’t a very large appliance to begin with.

When complete, you should have an appliance ready to be deployed into another vCenter environment. Or do you?

## Importing OVF Files

You should now have a file sitting on your local file system. It’s fine to import it. To do so, you’ll need to query the datastore to import it into along with the VM host. You can then use both objects to pass to the `Import-Vapp` cmdlet to import it.

```powershell
PS6> $myDatastore = Get-Datastore -Name "MyDatastore1"
PS6> $vmHost = Get-VMHost -Name "MyHost"
PS6> $vmHost | Import-vApp -Source 'C:\Exported-OVF\My_VM_Template\My_VM_Template.ovf' -Datastore $myDatastore -Force
```

But wait! This doesn’t work. In my instance, this failed because I didn’t notice that I was actually connecting to another vCenter cluster.

Something happened when I began to import the previously exported VM appliance. A sea of red error messages.

I read the error message, and sure enough, the host is not a part of a vCenter cluster and therefore does not have proper licensing to complete the import using PowerCLI. This is a limitation that VMware enforces.

No worries, I could still connect to the web interface of the host and manually import using the HTML5 interface. The wizard walks you through each step, give the imported appliance a name, choose the OVF, datastore, deployment type (thick or thin provisioned), and verify the configuration. After that, select _Finish_ and the import begins.

While the previous import attempt would work great with a vCenter cluster, it was simply not going to work in this situation. This took a little longer than expected but was straightforward. [You can read more about the process here](https://docs.vmware.com/en/VMware-vSphere/6.5/com.vmware.vsphere.html.hostclient.doc/GUID-8ABDB2E1-DDBF-40E3-8ED6-DC857783E3E3.html).

In the end, the import was a success, and my colleague met their deadline.

## Summary

Until this exercise, I was not aware that not all PowerCLI cmdlets were available in all situations. However, Both of us learned a new skill and, while experiencing some unforeseen adversity, we still accomplished the task at hand.

Too often we rush through IT projects looking for the ‘quick’ fix. _Watch your speed_, take another minute or two to ask questions, step back and understand the problem you are trying to solve. You may find you’ll learn something new.

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fovf-file%2F&text=Import%20%26%20Export%20OVF%20Files%3A%20Move%20VMs%20Between%20Hosts)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fovf-file%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fovf-file%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2019/09/powercli-tutorial.jpg)

### [PowerCLI Tutorial: Boost Your VMware Management Skills](/powercli-tutorial/)

Begin your journey with our PowerCLI tutorial and elevate your VMware infrastructure management to expert levels. Learn essential tips and tricks today!

![](https://adamtheautomator.com/wp-content/uploads/2019/08/install-vmware-powercli.png)

### [VMware PowerCLI: Installation and Scripting Guide](/vmware-powercli/)

Download, install, and script VMware PowerCLI for efficient configuration deployments and VM reports.

![](https://adamtheautomator.com/wp-content/uploads/2026/06/26995-troubleshoot-dns-issues-powershell-codex.webp)

### [Troubleshoot DNS Issues with PowerShell](/troubleshoot-dns-issues-powershell/)

Troubleshoot DNS issues with PowerShell by testing name resolution, DNS client settings, cache entries, and network connectivity in a repeatable workflow.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
