How long does it take to restore from a backup?

Hello,
I’ve only been working with HA for a few months. I’ve been running HassIO on a Pi 3B+ and its been running well. I only got it running with help from the folks here!

A couple of days ago I made two small additions to configuration.yaml and checked them with the addon checker program. I restarted the system and it never came back. Once, when this had happened before, I took the SD card and, on my laptop, edited the configuration.yaml file to remove the change; and the system recovered.

I tried that this time and it would not start.

Backup plan: restore the system to a Pi 4.
So, on a new Pi 4 with the firmware updated, I installed the HassIO image and started it.
When it came up, I installed Samba and copied my backup file to the new system and started the recovery.

That was nearly 24 hours ago.
Watching the network traffic to the Pi, it has downloaded something over 20 MBytes. Right now, it small packets every minute or so.

The web interface has not come back yet.
Watching via Samba, files from my old install are slowly appearing and part of the config file is there.

Is this how it works?
How long should it take?
Should I start over with a different backup file?

Thanks,
-Mike

When you say backup file, how was it generated? Was it a hassio generated snapshot? Or something else.

Also, samba gives you access to your log file. What does it say?

Repeat after me: Next time (and always with hassio) the first thing you install is ssh.

1 Like

nickrout asked:
When you say backup file, how was it generated? Was it a hassio generated snapshot? Or something else.

Yes, it was a hassio generated snapshot.

nickrout asked:
Also, samba gives you access to your log file. What does it say?

I didn’t know to look for a log. The file config/home-assistant.log:

2019-11-22 18:52:43 ERROR (SyncWorker_0) [homeassistant.util.yaml.loader] YAML file /config/configuration.yaml contains duplicate key “sensor”. Check lines 48 and 52.
2019-11-22 18:52:45 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=26 from 2019-09-03 03:24:46.204396)

Looks like it’s done for.

nickrout :slight_smile: Repeat after me: Next time (and always with hassio) the first thing you install is ssh.

I could never get SSH to work, so I didn’t install it this time.

I looked at the snapshot I tried to install and the configuration.yaml indeed looks like the one that was installed… duplicate key. I will try again with a different snapshot.

Thanks,
-Mike

Why not simply fix the duplicate key with an editor over samba?

Blockquote
nickrout said:
Why not simply fix the duplicate key with an editor over samba?

I thought about just copying a good config file over. I had copied it off the old SD card. But I had no idea what state the system was in…
The Pi boots and something on it was talking to the network, but there was no web interface to HassIO,
From what I could find/see with Samba, only part of the original config file was there and it was corrupt. It looked like the node-red flows were there… No Idea how much of the restored snapshot was there.

So I pulled the plug, re-flashed the SD, and started over.
It has been up for 3 hours and has downloaded about 24 Mbytes.
The configuration.yaml looks correct this time.
The node-red flows appear to be there
The only thing in config/home-assistant.log is:

Blockquote
2019-11-24 16:23:08 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=33 from 2019-11-20 19:07:10.268972)

I have no idea if it’s doing anything at the moment, but I doubt it. It can’t take that long to un-compress and copy everything in the 18M tar file.

I’m considering pulling the plug and installing everything manually again.

Thanks,
-Mike

No it shouldn’t.

Are you installing the same version of hassio as the snapshot was taken from?

The system was up to date on the Pi 3B+; hassio and all the add-on’s.
The Pi 4 was loaded from the current image from the web. So I assume they are the same version, but I didn’t check. I guess, if anything, the system image could be an older version of HassIO.

If I start over with a fresh install, could I copy the configuration.yaml and node-red directory from a backup on to the system? I don’t know if node-red just has json files or some database that might get out of sync…

Thanks again,
-Mike

Interesting:
in node-red, I had flows forwarding data from 4 temperature sensors that report to the MQTT broker on HassIO to Adafruit’s broker. I just noticed that 2 of them are forwarding data to Adafruit.

After that, I rebooted the Pi. There was a flurry of internet activity that continues, but the web interface is still not there.
I did get SSH working before I restored the last time. That part of the restore worked and the non-working SSH configuration was restored :slight_smile:

-Mike

It can be slow to restore a snapshot - always takes longer than I expect it to so some patience is needed. If you see errors after it comes back up, just restart HA server again and see if it persists after a restart. Also any logger/database error… try just deleting the database and restarting as well. If it was running previously when the snapshot was created it probably will run now as well unless some config change in a later version of HA is at play.

2 Likes