Is there an easy way to backup/restore Hass.io?

Backups aside, on the rPi3B+, I’d recommend getting a USB thumb drive (or better, an actual external drive) and using that instead of SD cards. You can boot up off of it and save a lot of money by not having to buy SD cards when they die.

Beyond that, use the snapshot add-on.

This is what I use.

2 Likes

I just moved Hassio from RaspBerry to Hyper-V

  • Installed Samba on Hassio
  • Took full snapshot
  • Copied snapshot from raspberry samba\backups
  • Set up Hassio on new HypeV machine
  • Installed Samba
  • Copied snapshot to hyper-v samba\backups
  • Rebooted Hassio
  • Wipe and Restored snapshot

And everything back to normal :wink:

If you are reluctant to change the way your hassio is configured as recommended by @code-in-progress ?
Then I would suggest imaging your SD card after any significant change. You can then use the snapshot to backup minor changes. While I do not use a pi for hassio I still do images of my drive. In this way should it fail then I can be up and running quickly too.

I posted about this a while ago here;

It does offer some insight how others handle this topic.
For the minimal downtime an image will create will easily be offset by the hours of configuration time.

1 Like

Thanks for mentioning the snapshot feature. I tried to use it long time ago and it didn’t work for me as HA refused to restore from a snapshot after an update.
At that point I did my research and went for SD card imaging, which I carried on for a long time but eventually stopped because it involved shutting HA down, taking out SD card, inserting in into PC and waiting for about 30 minutes (for 32GB card) for the process to complete (and then compressing the image).
I think I stopped doing that because it works well if you restore to the very same card. It will most likely complain about different media size if you try restoring to another card despite it being of the same nominal size (say, 32 GB).

I’m reluctant to replace SD card with a USB thumb drive/SSD as it only eliminates one of the weaknesses and I’d rather go barebone/Linux laptop way to improve reliability and responsiveness of HA setup.

The trouble with snapshots is it’s only readable by HA so it’s impossible to look inside and check that particular option/automation, one need to restore the whole thing…

You should be able to open them with archive manager in a linux desktop. that will allow you to extract a file to restore. They are after all .tar files!
If you are a Windows user then try 7-zip.

Also a good practice is to run snapshot both before and after any update.

95% of the work in any setup is the config. If all you do is copy your configuration.yaml, ui-lovelace.yaml and ‘other’ yaml files then you’ve saved yourself days of work.

As far as I’m aware the snapshots are now pretty version insensitive but there maybe breaking change issues.

I would be concerned about “samba being flakey” that implies a much greater problem as this sort of software is not picky about how you hold your tongue. Maybe a dodgy cat 5 (or 6) cable or a dirty connection in a port ?

yeah, I was happy to know that my config is backed up and ready to restore BUT I was really annoyed when I realised I need to go and change all those input_numbers for things to work as expected.It’s especially important as nowadays we can enable/disable automations from UI - on a new system all automations are on by default…

that is exactly what stops me from going that way (maybe I’ll combine it with my current approach?)

agree, but don’t know how exactly to tackle it. doesn’t happen when I connect to Windows shares.
will try to replace the cable (almost 100% sure I did it in the past). apart from that no dirt, nothing suspicious… :() It’s very annoying, but at least it does not corrupt my files :wink:

Another option…

You can download snapshots to a PC. Just click on the snapshot and there’s a down arrow at the bottom of the pop-up card. The file will be in the download directory associated with your browser, and you can move it to a directory on your PC file system. Alternately, you can use the Configurator add-on to download a snapshot, since it’s also needed for uploading it back to HA.

If you’re using the Configurator add-on, you need to get access to the ‘/backup’ directory where snapshots are stored. It’s at the root level above the ‘/config’ directory, so you should have the following line in the add-on configuration:

"enforce_basepath": false,

From there, you can upload and download snapshots.

Thanks, it really works!

Is it? I always use SAMBA, haven’t heard about this add-on… perhaps because I tend to edit my config on PC/in place through SAMBA manually.

Thanks for the hint anyway!

A while back, Configurator was a recommended add-on during a basic installation of Hass.IO. I see it now appears under Advanced Configuration:

https://www.home-assistant.io/getting-started/configuration/

Can anyone confirm if you can restore a backup from an older version of HASS onto a newer version? Breaking changes aside, would this work?

This does work.

You can choose, it is a full backup, including home-assistant (version xxx) as well as configuration, SSL, Share, Media and Local add-ons.
You can choose which of those you want to backup/restore :wink:

where can I find my lovelace config in shapshot.tar ? I have an issue that the latest snapshot is not recognized by home assistant, so I restored previous one. But there was really a lot of work in UI after that, so I would like to restore also lovelace config.

Assuming you are using the UI for config and not YAML (else you would know where to look) take a look at the storage directory.

Tread lightly in this directory, backup first, and be sure to stop HA, make your changes and then restart.

For those who are interested. I backup my ha with a full snapshot automatically. The issue is that it stays on your SD or SSD which if it crashes your snapshot crashes with it (personal experience :confounded:).

On a Mac you can install Automator which is an app to automated routine task on your Mac. I have configurated an small sequence which basically downloads the latest snapshot from my SSD card and stores it safely on my Mac. To restore in case of total loss you need to reinstall HA and upload the snapshot into the backup folder but that is easy and works smoothly. No longer sleepless nights!

There are also easier solutions:
One is automatic backup to a Samba share:
https://github.com/thomasmauerer/hassio-addons/tree/master/samba-backup

and one is automatic backup to Google-drive (to have it really outside the house):
https://github.com/sabeechen/hassio-google-drive-backup

Hi there, I also search for an easy way to backup my HA installation. I think I’ve done a mistake. I would try out the HA and liked it so much that I use my test installation productive now. I’ve installed the HA with Ubuntu Snaps. So, now I have a HA core installation and can’t use add-ons :frowning:

I’ve found some solutions for cloud backup and so on. But no ways to easy copy files to an USB drive or something.

I know how to create a snapshot with snap and the snaps are stored in /var/lib/snapd/snapshots. But I can only accessing it via root access. Is there an easy way to automate a copy to an connected USB drive? I’m not a pro in linux based systems and new to HA :smiley:

Thanks a lot!

I have been using this: hassio-addons/samba-backup at master · thomasmauerer/hassio-addons · GitHub

At least with me, it does not do the backup automatically but now I can easily access my HAOS folders from my PC/phone and copy everything I need to a safer place.

My HAOS setup is pretty new and I will be moving it to a dedicated miniPC so whatever.
I might need another solution coz the auto backup isn’t working.