Please Consider

I run a few websites and used to make enough to keep them going with Adverts. Since Adblockers became popular that income is gone. If you like my content, please consider buying me a coffee. Thank you for your support!

Buy Me A Coffee

September 3, 2025

Backup VMware ESXi using the commandline

VMware Logo

Use this method to backup a VMware ESXi host using the ESXi commandline. This is especially useful for users of the previously free version of ESXi. Since the Broadcom takeover of VMware everything regarding VMware has changed. Most people will probably change their virtualisation platform sooner than later. Until then this may be useful.

There are two conditions which need to be satisfied:

  • The destination build number of the host matches the build from which the backup was taken.
  • The UUID of the host remains the same.

You can backup and restore the host configuration using one of this method:

ESXi Command Line

Backing up ESXi host configuration data

To synchronise the configuration changed with persistent storage, run this command:

vim-cmd hostsvc/firmware/sync_config 

To back-up the configuration data for the ESXi host, run this command:

 vim-cmd hostsvc/firmware/backup_config 

Note: The command will output a URL (http://<host_fqdn_orIP>/downloads/123456/configBundle-xx.xx.xx.xx.tgz) from where you can download the backup file, either by opening it in a web browser or using other means like wget or winscp.

From a web browser navigate to http://<host_fqdn_orIP>/downloads/123456/configBundle-xx.xx.xx.xx.tgz
The backup file will be in the /downloads directory (default to browser or choose to download to a specific directory) as configBundle-HostFQDN.tgz

Note: To restore the configuration the destination ESXi host must be the same build as the ESXi host configuration data. The host build can be obtained using the command vmware -vl

Restoring ESXi host configuration data

The configBundle-HostFQDN.tgz should be renamed as configBundle.tgz before initiating the restore command. Put the host into maintenance mode by running the below command:

 vim-cmd hostsvc/maintenance_mode_enter

Copy the backup configuration file to the ESXi host or an available datastore. Reboot the host. This step is required, otherwise the restore workflow might not finish completely Once ESXi has rebooted, move the config bundle file to /tmp/configBundle.tgz. Then run this command to restore the ESXi host configuration:

vim-cmd hostsvc/firmware/restore_config 0

Note: Add a 1 to force an override of the UUID mismatch. For example:

 vim-cmd hostsvc/firmware/restore_config 1

Executing this command will initiate an automatic reboot of the host after command completion. However, starting from vSphere 7.0 U2, the configuration could be encrypted using TPMs and in which case, the -force option will not work if the host got changed. We need the same TPM that was used on the host during backup, to restore. In other words, from vSphere 7.0U2, the override will not work if the host has TPM enabled.

Reference: How to back up and restore the ESXi host configuration. Visited 2025-09-03

© Arnold Greyling 2025