home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.65k stars 29.94k forks source link

Restore from backup not working anymore #92282

Closed criticallimit closed 1 month ago

criticallimit commented 1 year ago

The problem

Tried to go back from Beta 2023.5... to my working 2023.4.4 Versions. Have daily backups but non of is restored anymore. Raspi disconnects from Network and after that nothing changes. Waited for 45 Minutes, but HA is not coming back. Unplug Power and repowering is bringing 2023.5.0b5 back. No Logs showing a problem with restore.

What version of Home Assistant Core has the issue?

2023.5.0b...

What was the last working version of Home Assistant Core?

2023.4.4

What type of installation are you running?

Home Assistant OS 10.1

Oneshotblu commented 1 year ago

same here... 2023.5 (final) broke Ariston / BMW / Smartthings integrations all at once ! !

mib1185 commented 1 year ago

@Oneshotblu this seems not to be the same issue, please open an own issue report

Oneshotblu commented 1 year ago

@mib1185 Actually it is the same issue, I tried to restore a backup because several integrations stopped working and I could not do it. The only difference is that I tried from 2023.5 final instead. Thank you.

SynoUser-NL commented 1 year ago

Having the same issue with restoring a backup. Want to move from my Debian 11 based HA Supervised install (2023.5.0) to HA OS 10 (2023.5.1.), both running on ProxMox as VM's. The backup file uploads fine in 2023.5.0 and .1, however restoring from full or partial (even 1 add-on or folder structure) does absolutely nothing. Tried restoring from the inital user prompt (after new VM HA install on ProxMox with bash-command) as well as after logging in from the GUI and by CLI command, both with same result. After waiting (first time even overnight) and rebooting, there is no change at all to the newly installed HA istance.

What is really frustrating is that there is no progress indication nor logging or communication from HA about restore status or what goes wrong.

Going to try to load a previous version (2023.4, if I can find out how..) as a VM on ProxMox and see if that allows restoring a backup, and if so update from there..

SynoUser-NL commented 1 year ago

Downloaded haos 9.5 version and installed this as a ProxMox VM. Result after 1 hour: image

VM CPU is constant at about 25% DiskIO is negligable..

criticallimit commented 1 year ago

agree!

We are all doing backups to restore when updates are going wrong. To be not able to do the restore because of the update is frustrating and a no go. just my 2 cent

jjvandenberg commented 1 year ago

Same issue overhere., Tried to restore a PI based config to a x64 based system to get better performance: no go. No logging, it just disconnects after the restore starts. Have been able to restore from PI to PI before without any problem.

SynoUser-NL commented 1 year ago

I installed HAOS9.5 on ProxMox. From there I restored a 4 month old backup (without updating Core or OS), then restored the recent backup. The first restore took almost 12 hrs (1.5 GB file), the second recent one a couple of hours short of a day (with a 1.8GB restore file). After that, with all entities restored and a bit of history missing, all appeared well.. Then upgraded HAOS (10.1). Don't know if this makes any sense, but that is wat appeared to work for me.

Backup\Restore is a shoot-and-hope-you-don't-die process as it is now, and in dire need of some love & attention.

mlg9000 commented 1 year ago

I upgraded to 2023.5.x and after several failed attempts was able to revert to 2023.4.6 because of multiple broken integrations. Now I can restore anything from backup even with 2023.4.6. Home Assistant core crashes and I'm left with a running VM.

jjvandenberg commented 1 year ago

Issue still occurs in 2023.5.4 :-( However: after leaving it for about 3 hours, it seems to have restored the full config. No idea why a small config of about 200 Mb takes 3 hours ..

stephenyeargin commented 1 year ago

Has anyone found a workaround? Mine has been offline for a week or two while waiting for a way forward.

RevLaw commented 1 year ago

This is probably also related.

Manual Restore Steps I performed and worked:

  1. I've used a Live boot Linux to browse the SD Card and copied the backups from there (if you got a backup file you can use skip this)
  2. I've reinstalled my Home Assistant and created a User.
  3. installed the Advanced SSH & Web Terminal add-on, and set User to "root" and SFTP to "true" (Check log if start fails)
  4. now i copied the files out of the backup tar ball (Backupxyz.tar.\homeassistant.tar.gz\homeassistant.tar\data) into the config folder per SFTP (/config/) and overwrite existing files in there
  5. Fully reboot the host
  6. To get your add-on back: Go into the WEB UI and upload your backup, restore the Partial backup and exclude "Home Assistant"
  7. Done

This is absolutely an awful way to restore and should only be used in the worst case like this issue. Hope restoring will be fixed soon.

smith844 commented 1 year ago

I am adding to this as I seem to have same issue. Trying to move from a VM in UNRAID to Pi 4/4Gb with USB SSD. Install works fine but then trying to restore from backup, either as part of onboarding or via cli just seems to hang. I have a large backup of 1.23Gb so have left it for a while. The last entry in the Supervisor logs is Restore folder SSL and then nothing. The UI stops working (8123) although I can still connect on observer and it all appears green. This is somewhat frustrating, not had issues this critical in a while with HomeAssistant and I have been a user since the very start.

criticallimit commented 1 year ago

Problem still exists in 2023.6.3

Same behavior. After executing, it starts, disconnects the connection, and disappears into the nirvana. RPi4 powered off after 30 minutes. Afterwards, it boots without having performed the restore. No errors in the log.

polsup2 commented 1 year ago

Unable to restore backup. The same behavior as decsribed above. Using putty client, got "ha core logs". Screenshot attached:

image

And - silence

HA info:

image

home-assistant[bot] commented 1 year ago

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (backup) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `backup` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign backup` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


backup documentation backup source (message by IssueLinks)

javigmsuperka commented 1 year ago

Hello guys,

Same here with HAOS @ Vmware VM.

image

those are the only logs i can check using Ha CLI ¿Is there any way to save more logs?

criticallimit commented 1 year ago

still not working on 2023.8.0b1

ghost commented 1 year ago

Can't restore 2023.7.x either. Tried clean install and upload backup.tar later to restore. After pressing the restore button the webdashboard disconnects (assuming it's doing it's restore thingie) but even after a night sleep over nothing seems to happen (tried many times, also older backups)...after taking power of then...it just reboots like nothing happened.

My historical database is 10GB don't want to loose it. Should't be that big of a problem?

Wish there was some indication of what's going on...

Using regular RPI4 with Home Assistant Operating System.

panhans commented 1 year ago

I cant restore my 1.9 GB Backup, too. Now I try to clone the data partition. Stay fingercrossed! I'd just run out of storage and I never had problems with restoring backups and now it's not possible in some cases anymore? I think its a very critical issue!

jocamane commented 1 year ago

completely agree this is the issue. backup and restore are essential in any program. please resolve this problem quick.

panhans commented 1 year ago

For those who want to stay on the same platform and, for example, only migrate to a larger hard drive like me:

  1. Install home assistant to your new drive, start it login once with throw away credentials
  2. shut down system
  3. take your old drive and the new one and connect it to a linux system
  4. Figure out the mounting points for your hass-os-data partitions (new and old one), e.g. by right click in the file browser. (e.g. /dev/sdc8)
  5. clone the old data partition in the new one sudo dd if=/dev/old of=/dev/new bs=10000000 (replace the paths with your mount points)
  6. Wait until its done (my 128GB partition took me 30 min )
  7. unmount the the data partition umount /dev/new
  8. check the file system sudo e2fsck -y /dev/new
  9. resize the data partition sudo resize2fs /dev/new
  10. connect your new disk to your system, boot it up and everything should be like before

//EDIT: Maybe its easier with belena edger. You can easily clone partitions with that tool. //EDIT2: Ok, I had partition errors with my first method. First it worked well. After a while ha went down. BelenaEdger deletes the other partitions. So this isn't a solution either.

jocamane commented 1 year ago

thanks for the explanation and help. Thank you very much, but in the 21st century there has to be a more expeditious method that most users can do. Any software MUST have a backup/restore to work well. It's the basics

it's my opinion, of course

panhans commented 1 year ago

Yes, it was and it is an essential feature. I do scheduled backups every 3 days and now I want to restore one and it doesn't work. I don't even know if this problem / bug is in focus of developers or is it just a problem of a few users?

Ucsus commented 1 year ago

This is probably also related.

Manual Restore Steps I performed and worked:

  1. I've used a Live boot Linux to browse the SD Card and copied the backups from there (if you got a backup file you can use skip this)
  2. I've reinstalled my Home Assistant and created a User.
  3. installed the Advanced SSH & Web Terminal add-on, and set User to "root" and SFTP to "true" (Check log if start fails)
  4. now i copied the files out of the backup tar ball (Backupxyz.tar.\homeassistant.tar.gz\homeassistant.tar\data) into the config folder per SFTP (/config/) and overwrite existing files in there
  5. Fully reboot the host
  6. To get your add-on back: Go into the WEB UI and upload your backup, restore the Partial backup and exclude "Home Assistant"
  7. Done

This is absolutely an awful way to restore and should only be used in the worst case like this issue. Hope restoring will be fixed soon.

I tried to restore the system for two days - I cursed everything! Ubuntu, Balena, HaOS, Debian 11, Debian 12, in a container, without a container, then dancing with a backup for another day - and so I didn’t really achieve a normal configuration, but it turns out you could just unpack the backup and restart... kmp! Thanks, dude!

issue-triage-workflows[bot] commented 10 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

SynoUser-NL commented 10 months ago

Afaiac this issue is not resolved. Restoring a backup takes way too much time. On a i5-T7500 SSD proxmox system a restore of HAOS from a HA full backup takes about 1.5 day. With no guarantee it will work properly after that or that the restore won't just stop without any warning. This needs to be addressed by developers.

criticallimit commented 10 months ago

Yes, for me it´s not working. Waiting more than 4 hours with nothing happens, I reset my Raspi. Tried several times on several Core versions. No longer working since 2023.4

jocamane commented 10 months ago

I have the 200MB database and last restore during 3 hours, but finish ok. It was important to have a feedback bar during the backup

panhans commented 10 months ago

Mi old raspi pi 4 takes one day to restore a 250mb backup. My mini pc with an n100 only needs half an hour.

darthdule commented 10 months ago

Restore not working, too. What surprise, I think featres like this never worked good. What I dont get: Once you click restore the web interface cannot be accessed, aynmore. Is this normal behaviour or just happening when restore does not work? I canceled the restore (reboot VM) and the web GUI is cannot be accessed anymore.

ghost commented 10 months ago

@frenck anyone seeing this issue? Restore still doesn't seem to work...which is a big thing.

Tested today:

-Made a backup of my runnign RPI400, 2023.11.2 home assistant OS.

-Put a Clean install of HA os on new 128GB Sandisk Extreme SDcard with RPI imager version 2023.11.2, on another RPI4. -At onboarding choose for restore. Uploaded my 3,5GB HA backup I just made of my running HA. -It says something like restoring.Can't see what is happening in therms of progress.... -Took around 30minutes before a full or partial restore dialogue pops up. -I choose full restore, it says it will restore in propably around 45min. -It says something like restoring again. Can't see what is happening in therms of progress... -4 hours nothing changes, I hit browser refresh to see if there might be progress... -No repsonse, then browser says it is Unable to connect. -I do a powercycle of the RPI4. -I'm back at the nice Welcome! screen to choose create smart home or restore.....

So it seems that it still doesnt't work... :-(

I'm running my HA OS system for more then 2 years on an SDcard which is offcourse nice, but i'm basically unable to backup the system to a fresh new SDcard. So the day SDcard fails i'm screwed :-(

alex-v-fraser commented 10 months ago

The same with HA Supervised core-2023.11 clean install on RPi4-64 + 128GB SSD. Restore lasts about more than an hour and HA frontend doesn't appear after restore and I can't access it. I tried this:

reboot
apt purge homeassistant-supervised
apt install ./homeassistant-supervised.deb
apt --fix-broken install
reboot

HA started, I got accsess to it's frontend, but none of the addons started

ghost commented 10 months ago

In tems of addons and connections: when i restored I did not hang the usb-dongles and stuff to my RPi because they where connected to the running production RBP...

jimmyeao commented 9 months ago

This should be a fairly high priority to fix - backups are pointless without the ability to restore, and my AppDaemon was broken during the recent upgrade. Now I cant restore by 14.x version of appdaemon to be able to do the "fixed" upgrade :/

777dawid commented 9 months ago

Ten sam problem na raspberry pi 4 4gb. Zrobiłem kopię zapasową na Debian 11 - zrobiona prawidłowo. Czysta instalacja ha supervised Debian 12 uruchamia się pojawia się ekran powitalny z informacją utwórz nowe konto lub skorzystaj z kopi zapasowej. Wybieram kopię zapasową pojawia się informacja że przywracanie może zająć do 45min. Czekałem 5 godzin bez efektu. Testowane również w sposób utworzenia konta tymczasowego i z tej pozycji przywracanie kopi zapasowej nadal bez efektu. Po ponownym uruchomieniu można się zalogować na konto tymczasowe.

codyc1515 commented 8 months ago

I faced the same issue and am looking into ways to resolve. Anyone facing this issue and willing to assist, could you please take the following steps when you have a moment free?

Steps to reproduce this issue

  1. Install HA on your new storage medium
  2. Set-up as a new install with dummy details - don't restore from backup and no need to configure anything
  3. Login with your dummy details
  4. Browse to Settings -> System -> Backups, in top-right corner - hit the kebab menu, then Upload backup and choose Full
  5. Presumably it will fail at this stage as the process is the same as onboarding - and that's okay!
  6. Use the back arrow and browse to Logs (Settings -> System -> Logs), in top-right corner - hit the kebab menu, then Supervisor 6.1. If you don't see the kebab menu, or option for Supervisor: enable Advanced Mode by clicking on your name in the bottom-left, then toggle on Advanced Mode and try again.
  7. Upload logs here

With your help, we can get this fixed. Thank you

ghost commented 8 months ago

Thanks finally someone is picking this up! I'm currently abroad, hopefully someone can supply you with the needed data before me. If not i hope to be back in a week or so...and then I can help.

-Does a Sky Connect usb stick needs to be connected when restoring? (if that device wes present in the source donor backup).

-Is it allowed that the "old donor system" is still availible in the network when restoring on another/new device? Or should this be offline because it will cause trouble? Oflline right?

codyc1515 commented 8 months ago

I don’t think a SkyConnect dongle is required; however, it goes without saying that ZHA would fail to initialise.

I’m actually not sure how HA handles conflicting mDNS. This may well be another issue. As good practise I would say you should never have two hosts on the network with the same name.

ghost commented 7 months ago

Hi, I did this for you and I came to step 5, so I've choosen Full, clicked OK. And then it started restoring and the connection was broken. So I couldn't do step 6 with the back butting thing... i'm now waiting for something to happen...

Did it with the same system the backup came from, so not 2 "the same" devices in the network.

codyc1515 commented 7 months ago

Okay no problem. Thanks for trying. Sounds like you got further than most here. Fingers crossed for 2024.2 where most of these fixes will be seen.

codyc1515 commented 7 months ago

This should be resolved now.

ghost commented 7 months ago

Not a word about this in the release notes of 2024.2.x But indeed I've been able to restore my HA on a new SDcard for many years now. WOW! thanks!

The only thing that seems to fail when putting backups back is my iBeacon blue-tooth won't be detected anymore :-(

Mrsash2020 commented 5 months ago

Yup backups are a mix. Had to restore but it went sideways, found the backup had corrupt files. I am on latest everything today. Wow

issue-triage-workflows[bot] commented 2 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.