Best way to backup Hass.io & its accompanying virtual machine?

Hey,

As complexity has increased, I’ve been looking at ways to backup my Hass.io installation, that currently runs in Docker on Ubuntu Server in HyperV in Windows 10.

What I currently do is system snapshots in the Hass.io panel and (manual) copies of my SMB config folder to OneDrive.

If I copy the Ubuntu Server .VHD file as well (or even copy just the .VHD file, since it contains the Hass.io config folder anyway), would that pretty much have me covered?

In case of a full-on meltdown, with loss of the Windows installation, SSD, etc., has anyone ever done a restore by simply sticking the .VHD file into a new virtual machine?

Thanks in advance for any ideas!

Things to remember, if using a database and you take a snapshot, unless the mechanism is aware of the database (and the other way as well) the database may not be in a consistent state.

Windows uses VSS calls to make sure all and any VSS aware apps, like exchange SQL flush caches and finish transactions.

I’m running HASS on a Ubuntu server hosted on a ProxMox host. I just use vzdump (backup tool) and say
“To hell with the database, i don’t need to know yesterdays data, i just need to get it running again”

For a phone system backup (on a production ProxMox host) i have to get a read lock on the database, then use mysqldump, finally releasing the database once that completes !

Recently i have been treating servers more like cattle, rather than special snow flakes.
Backup the configuration, document other changes (i.e. edit /blah/blah.yaml to include x y z) and copy/backup data that can’t be replaced.

Thanks, I had indeed not considered database consistency, but for the purposes of HA I am also of the “To hell with the database, i don’t need to know yesterdays data, i just need to get it running again” school of thought :slight_smile:

Basically what I’d like is to have automatic daily snapshots with no downtime (because even scheduled to happen at 3AM, there will be that one moment when the missus wants to go to the bathroom and the lights won’t turn on automagically) with minimum fuss involved in restoring from such a snapshot in the event that after some disaster the physical server will have to be remade from scratch.

If I could just install Windows, start HyperV and use a copy of yesterday’s .VHD file from OneDrive, it would be ideal and would get the house back online in less than an hour (plus the time required for possible hardware purchases, of course :slight_smile: ).

You never hear about the 99 times it works fine, but the one time it failed to turn on within 2 seconds you always hear it.

I’m sure there is a file limit size on one drive (but you might be using that as an example)

Virtuals are sooo portable, i had all my linux servers running on Hyper-v 2012 R2, then just copied the VHDs across (converted to qcow2) booted and done.

1 Like

Excellent, then I will go for that…OneDrive space is not an issue, because I have the Office 365 subscription for the whole family and we have 1TB each, whereas my whole Ubuntu virtual machine with HA database is 10GB or so.

Why did you convert your VHDs to qcow2, though? Just space reasons? It’s the first I hear of qcow2 and it seems to be mainly for only taking up as much space as needed, so “raw” VHDs should be fine if space is not an issue, no?

I think the single file limit size is 10GB on onedrive, so u might need to split the file in to chunks (like 4GB chunks, or 700MB to make it upload/download easyier)

I converted to QCOW2 as it supports snapshots, RAW and VHD don’t in Proxmox (which uses QEMU under the nice pretty interface)