Do not allow OS / HA upgrade unless you made a recent backup

Tags: #<Tag:0x00007fc41f93a8d8> #<Tag:0x00007fc41f93a810>

I’ve recently upgraded to OS 5.9, and during this upgrade my system got stuck. I had to reboot the hosting Pi by unplugging the powercord, and luckely the system came up again. This made me realize that I didn’t make a backup, and I was scared as hell that I could start all over again… :frowning:

So, my feature request is like so;

Do not allow doing an upgrade of the Os or HA unless you have recently (this day, last 24 hours), made a backup. Ofcourse you can make a ‘override’ checkbox for if you are sure of your case…

OK so you make the snapshot, but just left it in the backup folder.
You upgrade and brick your machine

How does this request help ?

1 Like

You can plug in the data drive from your HASSOS machine to another computer and copy the snapshot out of it before reimaging the drive.

Ooooooor more usefully and realistically, if you hit update and it detects you haven’t done a backup, it could make a backup and then prompt you to save it to another computer.

Could even have the supervisor keep track of when each snapshot was downloaded last so if you made a backup yesterday but didn’t download it, it prompts you to download it before the update.

Now that HASSOS supports using a separate drive for your data volume, separating that out from the same drive as HASSOS is installed on can provide a little security here too, since you could re-image the boot drive without erasing the data volume, but it doesn’t protect against the update failing in a way that corrupts data on mounted storage.

I’m upvoting this cause I think that even just reminding people to make and download a backup before updates is a sensible move, even if they then have to do it themselves, cause it’s easy to slip the mind of the average user, and home assistant is all about making the smart home accessible to all :slight_smile:

I’d also love if you could set a SMB or NFS share as the target director for snapshots, so it auto uploads them to somewhere else whenever you do one.


You’re reminded to create a backup, if you chose to ignore this reminder, or, make the backup and don’t download it, at least it was offered for to you.

This could potentially save a lot of people at lot of time.

Writing software is taking poeple by the hand and guide them along the right path. Advising them to make a backup before a riskfull upgrade is such guidence imho. I know many of the Linux people have a ‘you should have read the manual additude’. But this is such a small effort.

1 Like

Just pointing out that cock up’s will still be made

Oh god yeah, I work in IT Support and you wouldn’t believe some of the excuses we hear for people not keeping backups, even when explicitly directed to.
Making backups part of the process of updating is a good step to reduce how many cock ups will happen at least, cause it will remind people about doing it

1 Like

^^ Yes! This alone would be a huge benefit for me.

It fits well with the idea of a backup reminder before updating, which also has my vote.

For those of us running off an SD card, it would also reduce a lot of read/writes, which rumor has it can shorten the life of the SD card. Especially if you have daily snapshots set up.

As long as we’re dreaming here, having SMB support during initial setup, so you could select a snapshot off the NAS when prompted, would make the whole process much simpler.

Edit: Are these related ideas worthy of their own Feature Request? I don’t want to water down this one, but they do all sort of work together.

In the local \config folder, I have placed shortcuts/links to a) the HA backup folders on my NAS and on my local workstation (both the windows and linux machines) it’s a drag and drop operation.

Maybe setup a script that runs the backup / snapshot (I use the Google cloud add-on that backs it up to my Google drive) and when complete it runs the update?

Actually it would be cool if it was like the FreeNAS upgrade, where a dialogue pops up and gives you the option of taking a backup, when you click yes it automatically downloads the backup to the pc you initiated the update at.


Use this. It provides Google Drive-based offsite backup Add-on: Home Assistant Google Drive Backup

Once you set it up, it will sync your auto-backups to the cloud so you can always access them.

Nice but then you should definitely use a password.

And when using a password you can’t manually access contents of your backup (e. g. only taking the SQLite database), only a HA instance together with the password during a snapshot restore process.

You could use the SAMBA Backup addon instead and mirror the HA snapshots without passwords to another samba share in your network.

1 Like