Restore backup

Hello,

I’ve been spending all day trying to restore a backup but i can’t seem to get anywhere.

Background: HA had been running on a SD-card up till now and I switched to a ssd. The whole process went very well and I was able to Install a fresh instance of HA on the ssd without any problems.

Now I’m trying to migrate my old setup (which was acutally quite small) by restoring a backup. I can start the restoration process and then basically nothing happens. I’ve let it run for up to 2 hours but i can’t reconnect.
I don`t know if the restoration process fails, or that i’m just not using the right way to get back in again.
In my old setup I had remote acces with https through duckdns and letsencrypt enabled. I assume that this setup is also included in the backup? So i should be able to reconnect to HA by using the orignal url I used to get back in ( https://mydomain.duckdns.org:8123 ).

Is that assumption correct? Am I doing something obvious wrong or missing something?

Some help would be very much appreciated!

With “a backup” you mean a snapshot, do you?

Save that snapshot (tar-file) onto the SSD you are running HA from and when initiating the restore process point HA to that file on the SSD. This sometime helps.

When doing a restore of a snapshot your system including login settings, ip-addresses, internal and external url’s etc. are the same with the date and time the snaphot was done.

The terminology changed from ‘snapshot’ to ‘backup’ a couple of supervisor releases ago.

Thanks you both for your help.
The backup was created manually with the Google Drive backup addon.
I made sure to update HA and all addons in the old installation, before creating the backup. So there shouldn’t be any conflicts there.
I’ve now tried many different configurations of a partial backup as well and also left it running over night.

Every time with the same result (the “reconnecting” message appears after starting the restore, but after that there is no way of reconnecting to HA, in any way.

What else can I try? How can restoring a backup be this complicated?

There seems to be an issue with the supervisor and backups at the moment:

Thanks for the heads up.
Though I’m not sure that issue is related to my problem. It specifically seems to affect password protected backups (which mine is not).
I also do not get any errors in either the HA log, the supervisor log or the google drive add on log.

For now I inserted my SD-card with my old install again, which still works. I might wait for a couple of days and then try again.

It’s not the only issue. Most of them have been patched for the next release.

Looks like the restore problem is still not resolved in v2022.4. I still have this problem on RPI 3B+ and RPI4 B. Both with SD card and USB Drive.

Hello Eric,

for me the problem was fixed only 2 or three days after I encountered the problem.
It was fixed in a supervisor update. So try updating the supervisor as well as the core.

I’m having this exact same issue. HA wont come back after I restore backup/snapshot i created just this afternoon. I have spent all day trying everything suggested, but just cant get HA up after I restore.
I am on 2022.8.2 and fresh installed the same ver on SSD.

Having the exact same issue in 2023. Hopefully we can see a fix rolled out “soon”, perhaps, maybe…

Not sure if I have the same problem.
Trying to restore from a google drive backup. Have initially only selected HA as a partial backup. HA has restarted but on the Backup page in Settings, the wheel is still spinning, and I don’t see any noticeable change in anything. I believe I need to next restore individual add-ons, but do I need to wait until something happens - is there any message to say that the HA version has been restored ? Have seen comments that say this can take a very long time, but what sort of time could be expected for just an HA restore?

I discovered a few misconceptions, mostly present in similar feeds, regarding the restoration of a backup (partial or full) onto usually a fresh install or a new instance (it’s possible these statements are just outdated by others).

Onward with those discoveries

So I’m quoting these together in the event that @mike144 is similar to @assembly. Okay so if you are doing a restore that existed from an old device (that you stored on Google Drive) and are backing up onto a new device, and it appears to be taking hours - it actually isn’t. The problem may be that you are logged into a non-secure site, which is going to always happen when you start a fresh instance of HA. This is denoted by your http://youripaddress:8123. Instead after about 10-15 minutes (maybe longer depending on the size of your reinstall - mine was about 5 min to restore 350MB onto a Dell Optiplex 7050 - N2+, for example doesn’t have the speed of the Optiplex). Now, from your screen, it may appear that your HA is taking forever to reinstall, and it will appear that it is never going to work (kind of true). What you need to do is instead log onto a secure connection:

Take for example if your address for the HA instance when you did your fresh install (not the old one - that’s irrelevant as is the equipment. HA version maybe a different story) is http://192.168.1.38:8123. After a period of time, open a second browser window (keeping your original one up just in case) type in https://192.168.1.38:8123. You’ll likely find that after your hours of struggle, HA was waiting for you on the https site. If you never secured your original HA instance when it failed - this might not be relevant, but I’m going to guess that this will apply to 99.9999% of everyone reading this.

This is true, you can save time by sticking with a partial install that will just restore a backup of “Home Assistant” (as it appears in the partial set of options).

I would not recommend restoring bloated add-ons that may significantly increase your restore time, but if you have a restore size like mine (hardware depending) it’s pretty quick.

As said, hadn’t seen the comments on this feed, but others asking/making statements that if you have an external SSD or your hardware is significantly different you won’t be able to restore. That’s untrue and may be the result of the confusion with having to log on using the HTTPS. I was using an O-Droid N2+ with every single thing being run off of a 1TB external SSD. I went to a Dell Optiplex 7050, no Ubuntu loaded, just a x86 load with an internal NvME 512 GB. Once I knew what I was doing from the above comments, it was easy.

@mike144 Drop another reply to this if you’re still stuck.

2 Likes

Thank you for the very detailed reply. I am part of the 0.0001% who had not secured HA. I was in the process of trying to do this when my system basically crashed. I think because I could not get port forwarding sorted out. (was trying to get external access using DuckDNS - next time will try Cloudflare) So had to start from scratch (maybe there was another way but that is what I ended up doing).
So I have now got in as you suggested by opening a new browser tab (still using http). Have done all the partial reloads of the google drive backup that appear to be available to me.
BUT, it looks nothing like what I had before. In the overview, I only have a single tab, where previously I had five or six.
A number of integrations I had before have not come back. In the ZHA integration, it is showing 23 devices autodetected, although I have in excess of 100 zigbee devices that were connected before (although I guess I could “just” repair all of them.) None of my automations are there. All the entity names appear to have reverted back to their factory names, even though I had renamed all of them.
Am I missing something - does a “full” google drive backup not give you everything you had a the time the backup is done? There were many hours of device set up, figuring out automations etc, so am hoping I don’t have to re-do all of that.
Sorry I am pretty new to HA, and am not in any way computer savvy, so apologies if this is a dumb question. The other issue is that when I restarted the whole process (using Proxmox for what it is worth), HA appeared to see me as a new user, even though I am pretty sure i used all the same login credentials as the previous instance. And I missed the bit that said I could start from a backup - hopefully that is not a critical mistake.

That’s okay, we were all new to HA at one point, and this similar issue is something I struggled with recently myself.

I’m not familiar with Proxmox (heard of it, but never used it). If you created a new user with the same name and password, this wouldn’t make a difference, which sounds like what might have happened.

No, not critical at all. I started out with creating as a new user and then after restoring from backup, the original user choices were the only ones available, not any of the new ones.

Okay, a lot of unpack here. As long as you have a complete Google Drive backup, all of your automations are present. When you download the Google Drive backup onto your Desktop computer, double click it (should have something like WinRar to open the compressed file. Then scroll down and find .\homeassistant.tar.gz which you should also double click to open. Open the data folder and all of your /config from the backup are right there including your automations.yaml and configuration.yaml. Although you can transfer these files directly to your HA instance by using Samba Share add-on installed on your HA, and open your current HA files from your Explorer and copy these in (and restart), you should be careful doing this as it can cause errors. And without tinkering with the CLI interface (controlling your HA hub by connecting a monitor and keyboard to it - like DOS but still very different commands) it can be difficult to do proper restarts, reboots, etc outside of HA.

When you do a restore, did you try to restore only the “Home Assistant” and not your other addons/folders, etc? If you haven’t, back up your current work using Google Drive (just in case this fails to restore). Make sure that the “Home Assistant” version you’re trying to restore is the same version that you are currently using. If so, do a partial restore ONLY of “Home Assistant.” Wait for the restoration to complete (or just give it a plenty of time) and then open that second tab in your Internet Browser and log back in. You can also try http://homeassistant.local:8123/ and see what happens.

If your user accounts successfully transferred over and your partial restore was successful you would have access to all of your user accounts, dashboards, tabs, automations.yaml, device/entities and configuration.yaml. So it sounds like your partial restore didn’t work.

It’s possible that the issue you’re facing is something that is well outside of my wheelhouse. Do some more digging (I know that there is very limited information out there on the forums relating to this). It’s also possible that you will have to basically start over. If that’s the case, or if that’s what you decide, when you re-pair your devices, re-install your add-ons, create your SSL for logging in, remote access, etc - take FREQUENT backups. In the Google Drive backups add-on you can make comments. This will give you the opportunity to detail what changes you made. If the changes weren’t breaking, then make a few more adjustments, installs, etc before doing yet another backup. When making these backups would also suggest that for purpose of the “reinstall” to choose the options to keep the backups indefinitely on Home Assistant and Google Drive.

Also, as long as you have your Google Drive backup you can gain access to every single one of your automations, sensors, etc that you had before:

  • Open your backed up file with Winrar (or some equivalent).
  • When your compressed file comes up in Winrar with a list of more compressed files, scroll down and click on “./homeassistant.tar.gz”
  • In the next screen click on the /data folder
  • Here you will see your /config which will include automations.yaml, configuration.yaml and sensors.

You can reinstall these by installing Samba Share on HA and logging in via your Windows Explorer, but you should take caution as transferring automations and sensors and configuration.yaml could result in problems with future restarts/reboots.

Hopefully if there is more that I have not listed because of forgetting, or more likely, being green and ignorant, that someone much wiser will post some ideas that could provide even better help than the limited that I can offer.

Wow !
Thank you so much for all the time you have put into this.
Bit of a horror show so far today.
I am wondering whether I set up something wrong in the google drive back ups.
Extracted the files / directories from the full backup using Peazip, but when I tried to extract homeassistant.tar.gz file, I got an error:

7-Zip 22.01 (x64) : Copyright (c) 1999-2022 Igor Pavlov : 2022-07-15
Scanning the drive for archives:
1 file, 15588816 bytes (15 MiB)
Extracting archive: C:\Users\Michael\Desktop\HA Backup\homeassistant.tar.gz
Can’t open as archive: 1
Files: 0
Size: 0
Compressed: 0
2: Fatal error occurred,

So maybe there is a problem with the backups.
Given that the google drive backups are the only ones that appear to be available to me with this login, rather than any of the local backups I had done, I do seem to be hitting a brick wall. Do you know of any other way to access the local backups that I had, rather than the google drive backups ? None of them show up in the available backups section.

Then to add to my joy, this morning I have tried to add sambashare and the advanced ssh add-ons, and both are failing - in the case of sambashare, it tells me there is no configuration for this add-on, and with the ssh file I cannot get it to start, after adding in the username and password and an authorized key.

So am currently trying to start again with another restore from the google drive backup - and as suggested am staring with the partial download of HA first (although this is also what I did last time).
Will see what happens - more to follow I guess.

That’s a super tiny backup for HA. I am not sure if a blank slate backup instance of HA would cover that. Maybe Google Drive neglected to backup the proper files…?

I’m a little confused, so you have Google Drive Backups add-on installed on your current HA instance, but you can’t see any of your backups?

Hmm, well regardless, I’d suggest trying to download one of your other google drive backups. Then go to Settings > System > Backups > three dots > Upload backup. Then do your partial restore from there. I know it’s easy to ignore it, but sometimes there are “errors” listed in the HA logs. These may not show themselves without you clicking on the logs, but they can result in some corruption of a future restoration (fortunately, I haven’t had this happen to me in the ten or so months I’ve been using HA.

Yes, please keep me up to date. I’m curious what this issue could be, and I’m sure that finding the source of the problem and possible fixes will indeed help the community when they face a similar issue.

Thank you again.
I can access the google drive backups but have not get put the google drive add-on into home assistant.
I did do the local backups when I was running the previous HA instance, but these have all disappeared - again, maybe because it appears my login now is seen to be a new user.
I have now got ssh and samba share working - had to do a hard reboot of the machine I am using, but it did the trick. After some messing around, I can now see into HA from my windows explorer.
But in the end, I have now tried two different homeassistant.tar.gz files in the Peazip app, and both fail. Just reading a bit about it and it does seem like there might be some odd encryption on those particular files - for the two backups, I can extract the full backup into its constituent files / directories, but cannot extract anything from the homeassistant.tar.gz file.
Not sure whether this is going to help me:

For a non-computer guy like me, this is driving me nuts, so I really do appreciate you trying to help out.

Just realized that I cannot access any of the local backups I did before because I had the google drive backup limit set to 3 - so it deleted all the local backups I did before I started using google drive !
So if I cannot get the google drive backups to fully work, I am screwed.
So after a few more minutes, I think I give up. I am going to have to rebuild the system from scratch.
Not a whole load of automations, but about 120 sensors of various types (mostly Aqara), and a whole host of other things.
Frustrating that I had thought I would be ok in this scenario given that I had the backups, but clearly not. Still no idea whether there was anything I did when setting up the google drive backups that caused a problem, but having just set it up again, it is hard to see where I could have input anything to make the backups “go wrong”
Regardless, your massive efforts are totally appreciated, so thank you again