ESX Virtualization

VMware ESXi, vSphere, VMware Backup, Hyper-V... how-to, videos....

Nakivo Backup and Replication - #1 Backup solution for Virtual, physical, cloud, NAS and SaaS

Menu
  • Certification
      • VCP-DCV vSphere 8
          • vcp2024-125.
        • Close
    • Close
  • VMware
    • Configuration Maximums
    • vSphere
      • vSphere 8.0
      • vSphere 7.0
      • vSphere 6.7
      • vSphere 6.5
      • vSphere 6.0
      • Close
    • VMworld
      • VMware EXPLORE 2024
      • VMware EXPLORE 2023
      • VMware EXPLORE 2022
      • VMworld 2019
      • VMworld 2018
      • VMworld 2017
      • VMworld 2016
      • VMworld 2015
      • VMworld 2014
      • VMworld 2013
      • VMworld 2012
      • VMworld 2011
      • Close
    • Close
  • Microsoft
    • Windows Server 2012
    • Windows Server 2016
    • Windows Server 2019
    • Close
  • Categories
    • Tips – VMware, Microsoft and General IT tips and definitions, What is this?, How this works?
    • Server Virtualization – VMware ESXi, ESXi Free Hypervizor, VMware vSphere Server Virtualization, VMware Cloud and Datacenter Virtualization
    • Backup – Virtualization Backup Solutions, VMware vSphere Backup and ESXi backup solutions.
    • Desktop Virtualization – Desktop Virtualization, VMware Workstation, VMware Fusion, VMware Horizon View, tips and tutorials
    • How To – ESXi Tutorials, IT and virtualization tutorials, VMware ESXi 4.x, ESXi 5.x and VMware vSphere. VMware Workstation and other IT tutorials.
    • Free – Free virtualization utilities, ESXi Free, Monitoring and free backup utilities for ESXi and Hyper-V. Free IT tools.
    • Videos – VMware Virtualization Videos, VMware ESXi Videos, ESXi 4.x, ESXi 5.x tips and videos.
    • Home Lab
    • Reviews – Virtualization Software and reviews, Disaster and backup recovery software reviews. Virtual infrastructure monitoring software review.
    • Close
  • Partners
    • NAKIVO
    • StarWind
    • Zerto
    • Xorux
    • Close
  • This Web
    • News
    • ESXi Lab
    • About
    • Advertise
    • Archives
    • Disclaimer
    • PDFs and Books
    • Close
  • Free
  • Privacy policy

Backup and Restore ESXi Configuration with PowerCLI

By Vladan SEGET | Last Updated: August 8, 2015

Shares

In some situations you might need to backup or restore configuration of your ESXi host. This can be done with several tools with GUI front end or you can use tools diretly built-in ESXi and vSphere. And that's what we will explore today.

There might be a situation where the only choice is what you already have on a system which manages the environment and you don't always get the rights to install an additional utility. So PowerCLI to the rescue.

PowerCLI is one of the tools that are bundled for free with vSphere environment, and should always be installed on the management station or on vCenter (if Windows based). You can download latest PowerCLI here. Now, the process of backing up and restoring the configuration of ESXi is fairly simple. Scripting guys calls it one-liner…

Backup and Restore ESXi Configuration with PowerCLI, the steps:

Open PowerCLI > Connect to vCenter with Connect VI-Server command and enter this single line to backup the configuration of all the hosts that are attached to vCenter server. Note that during first connection you'll have to enable remote signing of scripts with a command:

Set-ExecutionPolicy RemoteSigned

Only after you can enter the backup command:

get-vmhost | get-vmhostfirmware -BackupConfiguration -DestinationPath “C:\Download”

ESXi backup config with PowerCLI

This suppose that you create the c:Download folder before executing this…

You'll get four files in a c:\download folder…

Nice isn't it..

config-backup

Restore operations

02. Now, if you need to restore a host's configuration, you need to put the host into maintenance mode first.

You can do it through the GUI or through the PowerCLI so in my example I enter this:

Set-VMHost -VMHost esxi5-03.lab.local -State “Maintenance”

As you can see it's possible to use FQDN, IP or hostname.

03. Enter the restore command:

Set-VMHostFirmware -VMHost <IP_or_FQDN> -Restore -Force -SourcePath

The host will reboot immediately after you hit the enter key. (without prompt).

So in my example:

How-to Restore host config with PowerCLI

As you can see it's an easy way to backup and restore configuration of your ESXi hosts.

Feel free to subscribe via RSS or follow on Twitter (@vladan)

Shares
5/5 - (4 votes)

| Filed Under: How To Tagged With: Backup ESXi config, ESXi configuration backup

About Vladan SEGET

This website is maintained by Vladan SEGET. Vladan is as an Independent consultant, professional blogger, vExpert x16, Veeam Vanguard x9, VCAP-DCA/DCD, ESX Virtualization site has started as a simple bookmarking site, but quickly found a large following of readers and subscribers.

Connect on: Facebook. Feel free to network via Twitter @vladan.

Comments

  1. Jay says

    July 2, 2015 at 6:38 pm

    Hi, Thanks for posting these commands. In a new environment this is really helpful to have a baseline to restore from. However, in my tests I noticed that it restored VMs that were present on the host at the time the backup was taken. Is there a way to exclude the backup from taking the VM list? When I restored a host after moving VMs around I noticed there were several ghost VMs. I know I could probably edit the vminventory file to remove the VM lists but it would be handy and save sometime to exclude the VMs, in case I just wanted to restore one host. Thank you.

  2. rl says

    December 31, 2015 at 6:58 am

    Hello Vladan,

    Thanks very much for this posting and commands. Was very useful in migrating between USB sticks. Saved me a lot of time and I got to use PowerCLI for the first time.

    Thanks again!

    -R

    • Vladan SEGET says

      December 31, 2015 at 7:38 am

      Thanks for reading our blog. You’re welcome. Glad it helped.. -:)

  3. James says

    February 17, 2016 at 7:50 am

    Hi Vladan. Will this restore even vSAN configurations?

    Thanks
    James

    • Vladan SEGET says

      February 17, 2016 at 10:54 am

      I don’t think so… and certainly unsupported…

  4. Richard Johnson says

    April 4, 2016 at 4:27 pm

    Hi
    What does this actually backup? e.g. IP details? vSwitch details? NTP? advanced config such as scratch location? syslog location?

  5. Kevin says

    April 5, 2016 at 9:34 am

    Is it possible to restore a ESXI 6.x Backup to the same host with a fresh install of ESXI 5.5?

    • Alok says

      May 14, 2016 at 12:05 pm

      I also am trying to format a host and the vsan so i have made the backup of the configuration, i wish to restore the ESXi host as it was maybe without the vSan as i would rebuild it anyhow.

      If you know a fresh installed ESXi can be restored with this config file please reply.

  6. Maria says

    June 11, 2016 at 11:54 pm

    Hello,
    Does this support vsphere 6.0?
    Thank you

  7. marcus wessberg says

    February 22, 2017 at 1:51 pm

    Really good, thank you for sharing

  8. Richard Hughes says

    August 8, 2017 at 7:26 pm

    Does this do the VIBs also?

    • Vladan SEGET says

      August 8, 2017 at 9:25 pm

      No, just the config. It’s not any kind of “image” backup. Saves time to reconfigure, when your USB stick fails.

Private Sponsors

Featured

  • Thinking about HCI? G2, an independent tech solutions peer review platform, has published its Winter 2023 Reports on Hyperconverged Infrastructure (HCI) Solutions.
  • Zerto: One Platform for Disaster Recovery, Backup & Cloud Mobility: Try FREE Hands-On Labs Today!
Click to Become a Sponsor

Most Recent

  • Veeam Backup & Replication v13 Beta: A Game-Changer with Linux
  • What is Veeam Data Cloud Vault and how it can help SMBs
  • Nakivo Backup and Replication – Malware Scan Feature
  • Zerto 10 U7 released with VMware NSX 4.2 Support
  • XorMon NG 1.9.0 Infrastructure Monitoring – now also with Veeam Backup Support
  • Heartbeat vs Node Majority StarWind VSAN Failover Strategy
  • Vulnerability in your VMs – VMware Tools Update
  • FREE version of StarWind VSAN vs Trial of Full version
  • Commvault’s Innovations at RSA Conference 2025 San Francisco
  • VMware ESXi FREE is FREE again!

Get new posts by email:

 

 

 

 

Support us on Ko-Fi

 

 

Buy Me a Coffee at ko-fi.com

Sponsors

Free Trials

  • DC Scope for VMware vSphere – optimization, capacity planning, and cost management. Download FREE Trial Here.
  • Augmented Inline Deduplication, Altaro VM Backup v9 For #VMware and #Hyper-V – Grab your copy now download TRIAL.

VMware Engineer Jobs

VMware Engineer Jobs

YouTube

…

Find us on Facebook

ESX Virtualization

…

Copyright © 2025 ·Dynamik-Gen · Genesis Framework · Log in