Add-on: Home Assistant Google Drive Backup

I set mine up so motion eye saved recording to /share/camera/ then set the backup snapshots to ignore “share”

@sabeechen, thanks for the awesome add-on. It works great and it is extremely user friendly.

I know it is called Google Drive backup at the moment, but are you considering other alternatives at any point in the future? OneDrive, Dropbox or even FTP would all be very helpful. The main reason is that my backups are quite large and I’ve hit the storage limit. I do have a private FTP server so that could be a nice alternative with practically unlimited capacity.

2 Likes

@sabeechen I’m having a problem with the add-on. It’s been making my daily snapshots fine, but today when I try to make a snapshot, it immediately deletes it. I’ve tried restarting the add-on, and rebooting my host machine. The problem persists. My HA system log shows

19-09-26 00:16:36 INFO (SyncWorker_3) [hassio.snapshots.snapshot] Snapshot folder homeassistant done
19-09-26 00:16:37 INFO (MainThread) [hassio.snapshots] Full-Snapshot c91f6d19 done
19-09-26 00:16:43 INFO (MainThread) [hassio.api.security] /snapshots access from cebe7a76_hassio_google_drive_backup
19-09-26 00:16:43 INFO (MainThread) [hassio.api.security] /snapshots/c91f6d19/info access from cebe7a76_hassio_google_drive_backup
19-09-26 00:16:46 INFO (MainThread) [hassio.api.security] /snapshots/c91f6d19/remove access from cebe7a76_hassio_google_drive_backup
19-09-26 00:16:46 INFO (MainThread) [hassio.snapshots] Removed snapshot file c91f6d19
19-09-26 00:16:51 INFO (MainThread) [hassio.api.security] /snapshots access from cebe7a76_hassio_google_drive_backup

Thanks so much for any help!

I totally agree I’m really wondering why we still have no standard ftp backup for hassio . Looking at the privacy which is held high with homeassistent cloud backup seems a bit weird to me though

+1 for FTP

Hi,
My sd broke. Fortunately I had this add on. When I restored the data half of it is missing. Lovelance, scenes, scripts, themes, users… is not there. Also, as some data isnt there, Hassio is broken, doesnt load up. What should I do, or how can I have all my data back. I still have the broken sd card, can it be restored?
I’m dessesperate, please help me.

Did you wait long enough for it to restore? It takes much longer than you expect. If you have a linux machine or can install an ext2 (4?) reader you should be able to find your config as well.

You can put your sd card in a windows machine and use ‘disk internals linux reader’ to save your config folder.

I’ve been following this; My SD card hasn’t failed yet, but I hear the horror stories and would like to have a restore strategy in mind (or better yet, written down) just in case.

My question is this: Can I just stick the SD card in my Windows machine and copy back the config folder?

Right now my rough idea is to re-install HASS.IO from scratch just like day 1, then copy over the config folder from backup.

Is there a better way? Is there a flaw in this logic?

I think a well-written restore procedure would be a good companion to this excellent add-on. I’d be happy to help with the writing part, but would need help with the technical details.

The config folder is where everything is stored, so on a fresh install this is all that needs to be copied. Just be careful, in Windows there might be some hidden folders.

1 Like

Once you have a snapshot of your config on your Google Drive using this add-on, all you need to do to get back up and running is this:

  1. Etch usual / normal HassIO iamge to new SD (or SSD depending on your hardware).
  2. Load SD / SSD into RPi / NUC / whatever HA server hardware.
  3. Boot HA server and let the install do it’s thing.
  4. Download your snapshot from Google Drive to your PC.
  5. Go into HassIO side menu, install Samba add-on or SSH add-on.
  6. Use Samba or SSH to transfer the snapshot from your PC to the ‘backup’ folder on your HA server.
  7. Go to HassIO side menu, then ‘snapshots’, click on the snapshot and select ‘restore’.

HassIO will then restore your system to how it was at the time of that snapshot. Simple.

The whole purpose of HassIO snapshots is so you don’t have to try and copy individual files out of the snapshot back onto your SD/SSD/running system, risking missing any files that windows doesn’t see / are hidden etc. You just tell HassIO to restore from the snapshot and everything is done for you.

1 Like

It’s even easier with this add-on:
4. Install this hassio add-on again, link it to your Google account
5. Choose your snapshot from within the add-on and Hit “restore”
6. Wait for it to complete and be amazed :wink:

1 Like

Good point, I didn’t even think of that! I was still in the old mindset from before we had this add-on

This all got me thinking. (Dangerous habit, I know.)

What if I had a second Raspberry Pi all set up running a vanilla version of HA. No sensors connected, just kinda sitting there doing nothing but keeping up with updates.

When my “real” RPi croaks, could I just pull my HUSBZB USB stick out, plug it into the backup, run the restore and expect everything to work? The usb_path is defined in configuration.yaml, so no problem, right? Of course I’d power off the “new” RPi before plugging in the USB stick.

Besides having a hot backup platform, this would also give me a test environment. Presumably, anything I play with there would be erased when I did the restore, so I’d be free to try stuff I might not want to do in my production environment.

Maybe I just needed an excuse to buy another Raspberry Pi :wink:

It can definitely be done. When I switched to a NUC I still had my RPi running along side it for a little while until I was happy everything was working fine. For wifi devices (ie: anything not requiring my z-wave dongle) it simply monitored all status’s. In order to make sure it didn’t cause trouble with the NUC I turned all the automations in the RPi off

So, when trying to open ingress sidebar link or web ui in addon I get 502: Bad Gateway. Looking at the log the addon is functioning just as always, backing up to google drive.

The could be a problem with the addon or Hassio. Hassio proxys requests to the addon’s web UI through nginx (I think) and a lot of things can mess that up (eg if you use a proxy or a strange network setup). I’ve seen 502: Bad Gateway come up when the addon is just starting up and cant serve requests yet. I’ve also seen it just start happening randmly after Hassio is left on for a long time. Aside from the usual remedies (restarting the addon, home assistant, hassio, etc) do you see anything show up in the supervisor logs?

You could also try adding "expose_extra_server": true to the addon config. That will expose the web ui directly on port 1627 (eg http://hassio.local:1627). If that works then the problem is most likely something in hassio or home assistant’s config.

I’m getting an error trying to upload my snapshot to my new instance of home assistant. Even if I use Samba and put snapshot in backup folder it won’t read it??

Traceback (most recent call last):
File “/app/backup/uiserver.py”, line 523, in handleError
return call()
File “/app/backup/uiserver.py”, line 439, in
return self.handleError(lambda: self._upload(slug))
File “/app/backup/uiserver.py”, line 442, in _upload
self._coord.uploadSnapshot(slug)
File “/app/backup/coordinator.py”, line 122, in uploadSnapshot
self._withSoftLock(lambda: self._uploadSnapshot(slug))
File “/app/backup/coordinator.py”, line 211, in _withSoftLock
return callable()
File “/app/backup/coordinator.py”, line 122, in
self._withSoftLock(lambda: self._uploadSnapshot(slug))
File “/app/backup/coordinator.py”, line 134, in _uploadSnapshot
created = self._model.source.save(snapshot, self._model.dest.read(snapshot))
File “/app/backup/hasource.py”, line 215, in save
raise UploadFailed()
backup.exceptions.UploadFailed

did you refresh on the snapshot page? there is an icon to click in snapshots to do that.

Yep, I did refresh. Doesn’t pick up snapshot. Even restarted as well.