Using the ESXi Command Line to Backup and Restore ESXi Configuration

Backup the config:

To start, SSH into the host and log in.

To synchronize the configuration changed with persistent storage, run the command:

  • vim-cmd hostsvc/firmware/sync_config

To backup the configuration data for an ESXi host, run the command:

  • vim-cmd hostsvc/firmware/backup_config

Note: The command should output a URL in which a web browser may be used to download the file. Replace “*” in the URL with the host's IP address. The backup file is named configBundle-<HostFQDN>.tgz

Restore the config:

Note: When restoring configuration data, the build number of the host must match the build number of the host that created the backup file.

Put the host into maintenance mode by running the command:

  • vim-cmd hostsvc/maintenance_mode_enter

Copy the backup configuration file to a location accessible by the host and run the command below. In this case, the configuration file was copied to the host's /tmp directory. For more information, see https://kb.vmware.com/selfservice/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=1918.

  • vim-cmd hostsvc/firmware/restore_config /tmp/configBundle.tgz
  • Note: Executing this command will initiate an automatic reboot of the host after command completion.

Modified from: https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2042141

  • dr/vmware_esxi_backup_config.txt
  • Last modified: 2019/03/15 16:43
  • by ericclaus