VMware VM Backup Before Migration: Step-by-Step
In this article
Backing up your VMware virtual machines before a migration is your safety net. It ensures that if anything goes wrong during the move—corrupted files, network hiccups, or configuration errors—you can restore your VMs to their pre-migration state quickly and without data loss. This guide walks you through creating reliable backups using VMware’s native tools and best practices.
What You'll Need
- Access to the vSphere Client (web or desktop) with permissions to create snapshots and clone VMs.
- Enough storage space on your backup destination (at least the size of the VM’s virtual disk files).
- A backup destination: an NFS or SMB share, a secondary datastore, or a local drive with sufficient free space.
- Optional: VMware vCenter Server (for centralized management) or standalone ESXi host access.
- Optional: A backup software like Veeam or Nakivo if you prefer automated backups, but the steps below use native methods.
Step-by-Step
- Power off the VM (if possible). For the most consistent backup, shut down the guest OS. This ensures all files are in a consistent state. If you cannot power off (e.g., production), skip to step 3 but be aware of potential data inconsistency.
- Take a snapshot (optional but recommended). In the vSphere Client, right-click the VM, select Snapshots > Take Snapshot. Name it something like "Pre-Migration Backup". This gives you a point-in-time state that you can revert to if needed. Note: Snapshots are not a substitute for a full backup—they rely on the original disk and can degrade performance if kept too long.
- Clone the VM. Right-click the VM and select Clone. Choose a name for the clone (e.g., "VMname-Backup-YYYYMMDD"). Select a destination datastore or host that is not part of the migration target. If you have vCenter, you can clone to a different cluster or datastore. If you only have standalone ESXi, you can clone to the same host but a different datastore—just ensure you have space.
- Choose clone options. In the clone wizard, decide whether to customize the guest OS (usually not needed for backup). Keep the default settings. If you want a full independent copy, make sure to select "Create a full clone" (the default).
- Start the clone. Review the summary and click Finish. The clone will be created in the background. Wait until the task completes successfully.
- Export the VM (alternative to clone). If you prefer an off-site backup, you can export the VM as an OVF/OVA template. In the vSphere Client, right-click the VM, select Export > Export OVF Template. Choose a location on your local machine or a network share. This creates a portable backup that can be imported later.
- Verify the backup. After cloning or exporting, verify that the backup is complete and accessible. For a clone, power it on in a test network (if possible) to ensure it boots correctly. For an OVF, check that the files (OVF, VMDK, MF) are present and the sizes match the original.
- Document the backup. Note the backup location, date, and VM name in your migration plan. This helps you find the backup later if needed.
Common Mistakes
- Skipping the snapshot. A snapshot provides a quick rollback point during migration. Without it, you might have to restore from a full backup, which takes longer.
- Backing up to the same datastore as the source. If the datastore fails during migration, you lose both the original and the backup. Always use a separate datastore or network location.
- Not verifying the backup. A backup that cannot be restored is useless. Always test the clone or OVF before proceeding.
- Keeping snapshots too long. Snapshots grow over time and can fill up the datastore. Delete them after the migration is successful.
- Forgetting to include configuration files. Cloning captures the VM’s configuration, but if you manually back up only the VMDK files, you miss the .vmx and other settings. Use the clone/export method to capture everything.
Tips
- Use vCenter for centralized management. If you have multiple hosts, vCenter allows you to clone VMs across clusters, making backups more flexible.
- Schedule regular backups. If you have a long migration window, consider taking a snapshot right before the actual cutover, not days in advance.
- Compress the OVF export. When exporting to OVF, you can choose to compress the files. This saves space but takes longer.
- Consider using Storage vMotion for migration. If your migration is just moving VMs to a new datastore, Storage vMotion can move the VM without downtime. But still back up first—it’s a safety net.
- Automate with PowerCLI. For large environments, you can script the backup process with VMware PowerCLI to save time and reduce human error.
Troubleshooting
- Clone fails due to insufficient space. Check the destination datastore’s free space. If it’s full, free up space or choose a different location. Also ensure the datastore is accessible (not in maintenance mode).
- Export OVF fails with network errors. If you’re exporting to a network share, ensure the share is mounted and writable. Try exporting to a local drive first, then copy the files manually.
- Clone succeeds but VM won’t boot. This often happens if the guest OS has application-consistent issues. Power off the VM before cloning to avoid this. If it still fails, try using a backup tool like Veeam that uses VMware’s CBT (Changed Block Tracking) for application-consistent backups.
- Snapshot consolidation fails. If you took a snapshot and then try to delete it after migration, but it fails, the VM might be in a bad state. Use the vSphere Client to force consolidation, or contact VMware support if it persists.
- Backup files are corrupted. Always verify the checksum (if provided) or test the backup. If corrupted, redo the backup. For OVF, ensure the .mf file is present and matches.
Frequently Asked Questions
Can I back up a running VM without shutting it down?
Yes, you can take a snapshot of a running VM, but the backup may not be application-consistent. For databases or critical applications, use VMware Tools to quiesce the file system or use a third-party backup tool that supports application-aware backups.
What’s the difference between a snapshot and a clone?
A snapshot is a point-in-time reference that depends on the original disk; it’s quick but not a full backup. A clone is an independent copy of the VM’s virtual disk and configuration, which is a true backup.
Where should I store the backup?
Store it on a separate datastore, ideally on a different physical host or storage system. For extra safety, keep a copy off-site (e.g., on a NAS or cloud storage).
How long does the backup take?
It depends on the VM size, storage speed, and network. A small VM (20 GB) might take minutes; a large VM (1 TB) could take hours. Plan accordingly.
Can I restore the backup to a different host?
Yes, you can clone or export to a different host, as long as the host is compatible (same CPU vendor, etc.). You may need to adjust network settings after restore.
Do I need to back up if I’m using Storage vMotion?
Yes, because even though Storage vMotion is designed to be non-disruptive, there is still a risk of network or storage failure. A backup gives you a fallback.