Restoring snapshot doesn't do anything

After attempting a restore from the Snapshots view, only one warning and one error are shown. So it must be related to the following:

2021-04-12 14:57:44 WARNING (Recorder) [homeassistant.components.recorder.migration] Database is about to upgrade. Schema version: 13
2021-04-12 14:57:50 ERROR (MainThread) [homeassistant.config_entries] Error importing platform config_flow from integration hassio to set up hassio configuration entry: No module named 'homeassistant.components.hassio.config_flow'

I would try doing a restore, but uncheck the first checkbox - the option to restore Home Assistant itself (Core). 2021.4 included a database upgrade, and that may be related to your issue. If that works you could restart Home Assistant and let it auto-detect the newest version of Core available and perform the upgrade. You can also revert to any previous version of Core by running one of the following commands in the Terminal window:
ha core update --version=2021.3.1
ha core update --version=2021.3.2
ha core update --version=2021.3.3
ha core update --version=2021.3.4
ha core update --version=2021.4.1
ha core update --version=2021.4.2
ha core update --version=2021.4.3

Thanks for the suggestion! I tried it but had no luck. After running the terminal command to revert to 2021.3.3, upon reboot the onboarding page appears and refreshes in a constant loop. Very strange.

I’m wondering if this is a new bug introduced by the database upgrade in 2021.4. Perhaps restoring a snapshot from a previous version fails due to this.

Next I’ll try to find a way to get a clean install of 2021.3.3. Not sure how to go about that yet.

I’m back up and running, but it wasn’t pretty. After extracting the files in my snapshots, I noticed two problems. One, most of my configuration files (even configuration.yaml itself) were missing even though I was doing full snapshots. Two, the snapshots included and old, corrupt database file that I had just never deleted from the RPI. I’m thinking that might be the database conversion error, and of course not having all the .yaml files had to play a role as well.

I found an older snapshot that had all the missing files. I extracted them from the .tar file and then copied them over to the RPI using Samba Share after a clean install with the latest Home Assistant core. To my surprise, everything came up and just started working. :grinning:

Oh man… i just had the same problem and I don’t have an old snapshot, just the later ones from google drive… =(

Is it just me or is HomeAssistant Snapshots a false hope of reassurance when it comes to backups. My snapshots are all working with all files there but after a restore the WebUI just never comes up. I’m going to try fresh install and only copy the config files excluding the DB as Ive tried copying everything and then it just does the same as the snapshot restore.

2 Likes

Same here. Also: if it install HAOS 7.1 on a fresh new SD card, the “preparing” will never end until I connect internet again. And connecting internet will mean that HAOS will auto-update to the latest core and supervisor, rendering useless the backup restore process, since 2022.3.3 since to have a lot of issues doing so. I’m totally stuck with no solution.
It’s really unbelievable that I cannot restore a (ie) December 21 backup on a December HAOS release (7.1 for example) without incurring in an auto-update that would rendere everything useless.
Also: you can rollback the core to a previous version, but can’t do so with supervisor.

1 Like

Same here. I struggling with this for more that a week now. The restore just does’nt do anything. I tried 3 different USB sticks and several older release from Hass (7.1 & 7.0). I have the same issue on both a RPi 3 & 4. I’m going to try the solution from fenster24. I’ll keep you posted.

Restoring from backup snapshots certainly isn’t a user-friendly experience. I think what ultimately allowed my restore to succeed was manually restoring all the files except the database.

If this turns out to be the solution for anyone else, perhaps a new feature request would be to add a new option during a restore to exclude the old database (and any other DBs in the snapshot) and start a new DB from scratch. I think at this point in failed restore efforts, everyone else would be more than willing to lose their device history just to get the system up and running again with the configuration they spent so long customizing to their needs.

1 Like

OK, this seems to work. Thanks

1 Like

Glad it worked! I’ve created a feature request to start with a new DB during the restore process here. If anyone else experiences the same problem, please jump over and add a vote.

https://community.home-assistant.io/t/add-option-to-start-with-a-new-db-from-restore-dont-restore-backed-up-db/402156

Hi, I’ve failed to restore a backup to VM instance that crapped itself a few days ago. I’ve tried using the latest vm/ova image and see on GitHub that many are struggling to restore on the recent ha os. Does anyone know where I can download older versions of the ova image 7.1 or 7.2 with core 2022.3.1? Thanks

You can exclude the database from being inside your backups if you want. Won’t help with existing backups but helps for the future. Also the backups size decreases dramatically.
It’s not native but let me know if this is what you want to do.

I spent very much time but nothing works. Snapshot is very very bad.

Snapshot backups have never let me down.

I have a Backup on my RPI 4 and would it use on my Intel NUC with Windows and Home Assistant in VirtualBox but nothing do ifI use the snapshot to restore. I have do another snapshot but still nothing do.

You are lucky. I cannot get any to restore on a newly built HA OS install.

The big issue which HA has never addressed is that you cannot ever reliably do a file-level snapshot on a running database, be it SQLite or Postgres/Timescale or MariaDB or whatever. You’re almost certainly guaranteed to create at least a partially broken backup, and you can also break the running database. A config-only backup without any history isn’t much of a backup at all for those of us primarily using HA for monitoring basic stuff. The core team still haven’t seen any pressing need to add hooks into the backup process to trigger a proper db dump, so the entire backup/restore process is just fundamentally broken. It’s weird!

I’m in the same miserable situation… qq: when you say DB, do you mean homeassistant_v2.db?

I should elaborate. I have never gotten a partial restore to work, so I only do full snapshot/restores.