Backup / Restore procedure for HAOS

Hi all,

So last week, I wanted to write a restore procedure for a full install HAOS restore of my home HA.

So my starting point is a full backup of HAOS running in a VM. Quite big at around 4 gig. My home HA for the source backup is quite big, with lots of add-ons, plugins, data, automations etc. The usual after a few years of tinkering.

For the test, I used a physical small PC, booted Ubuntu from USB and installed (imaged) the local disk. When rebooted, I pointed to the latest full backup of my home HA. It took a while! Maybe 5–6 hours?

When that was done, I paused (VM) the source HA.
Then from the attached console, I renamed the HA I just restored to not have conflict on the .local name, since they are on the same network.

Then I connected to the test HA. When I started poking around, I saw that many add-ons were not running. The only one that seems to be running was InfluxDB. Grafana, Node-RED, SQLite, Studio Code server and terminal did not want to start. When clicking the start button, it simply turns around forever. I looked at some logs, debugged for around half a day, could not find anything obvious.

So finally, the question!
When doing a full restore like this, what is the procedure to do so?
Do we install base HAOS then add-ons, then restore ?
What am I missing?

Thanks! Simon

You do not state which VM product you are using.

The source HA is HAOS on Virtual box. That should not be important.

I rebooted the testHA.local machine this morning, I did a shutdown last week after a day of working on it.

Looking around the testHA.local that I restored, I see now that the add-ons are running now.

So, here’s my observation so far:

  1. Installed a fresh HAOS on an empty machine
  2. Restored a full backup from another HAOS instance.
  3. Renamed the machine to testha.local
  4. ADD-ONS are not started
  5. Did a couple of “Restart Home Assistant” from the GUI, that did not solve the issue
  6. Complete shutdown of the machine
  7. Boot up of the machine, add-ons works now.

Is this expected?

Were your HA fully updated when you made the backup?
A restore will install HA’s config library, but the HAOS is the one you installed when you prepared for the restoring of the backup.
The HAOS might not be compatible with the addons version being restored and the addons therefore needs to be redownloaded.

A complete reboot is required if your HAOS is on DHCP, but even on static IP, you need to ensure your other instance is not running. There are gotchas with networking and how it is configured so you need to pay attention.

When a backup restore has taken place I always suggest a fresh cold start of the system to ensure all changes are effective.

Yes, when doing a quick search in the forum…

Just the first 5 search results…

Also could have shared that logs with us like described here:

I did a full backup of HAOS last week and everything was updated. Then I installed HAOS from a fresh image of the same week. So maybe there were some differences, but mostly everything was updated and very close to the same version.

This morning, on the test restored machine, everything seems started, and HA is telling me to update a bunch of add-ons, core, and OS.

My main question remains. What is the best practice to restore?

My scenario is the following:

  1. I have a production system, that I keep updated as much as possible. There is potentially a delay of 1-2 weeks on some updates.
  2. I keep a full backup after a full update and smaller backups per add-ons as recommended when doing an update.
  3. I want to write a procedure on how to reload HAOS from scratch if I lose a physical server.

So far, it seems to work after a complete shutdown of the physical machine and reboot.

I will run the updates on the testHA restored machine to see if there are some surprises.

The data, automation, sensors, and configurations are important to restore after a hardware failure.

Let’s get some facts out of the way.

  1. No system is considered production worthy when it is based on Virtualbox or running under Windows with any virtualisation tech.

  2. A production worthy system relies on a full VM backup, not the HAOS backup.

For your needs it does not matter how you restore. All it matters is you start the new system from cold once the restore has been successful and you old instance is not on the same network as the new instance.

1 Like

I agree.

  1. I’m doing testing right now, not trying to restore a full production system.
  2. I’m using my home instance HA to do testing, I’m aware that running on the same network I will have many things that depend on a fixed IP not working
  3. The “production” system I’m running outside my home network, is not running in a VM, but on a physical box SSD drive.
  4. If I get into a situation where I will need to rebuild a failed physical box, the IP, and network would be the same as before.
  5. I would first install HAOS by using Ubuntu to image HAOS on the local SSD drive, then using a full backup to reload everything

I hope this help clarify what I’m trying to accomplish. And thanks for participating, it would be boring to discuss alone.

I now understand. It is a BM restore you require. The procedure is as you described.

  • Install HAOS on a new BM system.
  • Restore backup
  • Once restore successful, powerdown system
  • Powerup new system, ensuring you old system is not on the LAN

Congrats you are up and running.

Personally, I used VirtualBox for my production and development Home Assistant systems for the first 18 months I used HA. I ran it on top of Windows 10 Pro and both were extremely reliable and ran months without issue. I was running version 6.x of VB and never migrated to 7.x. My only complaint with VirtualBox would be USB passthrough, which could occasionally be buggy on startup. I moved all my USB passthrough devices to TCP connections so that became a non-issue for me.

For one-off, operational recovery support, VirtualBox supports snapshot backups, which I would highly recommend using before any upgrades or changes to your system. It allows you to roll-back to the pre-upgrade state without issues. For longer term DR backups I’d recommend an unattended scripted backup like this GitHub - niro1987/VirtualBox-Backup: An automated backup for Oracle VirtualBox VMs in Windows coupled with an offline copy of the backup files. I ran this strategy in Production and it never failed me.

VM level backups would be my first choice. I still run backups in Home Assistant coupled with Google Drive Backup for offsite storage but I’ve never had to rely on restoring one. I have had to roll-back a snapshot as well as recover from a copied backup with the VB strategy above. Never had a failure.

For the Windows OS I rely on System Image backups built into Windows. I’ve had to recover those as well, never had a problem.

That said, I’m now on Proxmox for all my VMs. It is also very capable. I no longer maintain Windows 10 Pro (It was originally installed to support HomeSeer, before they had a Linux option).

Plan ahead and make sure you understand and exercise the plan and you should be fine.