Snapshot restore from CLI

Hello guys. Just installed Hass.IO, which was a really great experience.
Well, until I tried installing: MariaDB, DuckDNS, Update notifier, SAMBA and SSH.
After rebooting the Pi3, I was not able to access the frontend.
I could SSH in, and got a very large error log.
But I guess that’s what happens. Doing a reinstall now.

What I really would like to propose, is a feature request for Hass.IO, which is being able to restore a snapshot from CLI.
This will help out a lot of people if they lost access to the frontend.

What do you guys think? Would this be a good idea?

2 Likes

The Hass.io API has actually support for it…

Will look into adding it to the hassio cli.

That sound great. Thanks!

On this topic, is there documentation somewhere about:

  1. How to do a snapshot restore?
  2. How to delete old/unused snapshots?
2 Likes

eric24

Did you determine how to delete stale snapshots?

I would like to know how to delete a snapshot. Anyone?

Can you not just delete the backup file the snapshot creates (and probably then re-start home assistant)?

Deleting the backup file from the file system seems to work. It didn’t require a restart, just a refresh of the page to see the update.

Did you learn how to restore a snapshot from command line?
I can’t access a remote HassIO (that is in my mothers appartment), and I want to restore a snapshot with SSH.

has there been any update on this? I was not able to access my instance of home assistance with anything but SSH and this would have helped

No sorry. Still haven’t figured it out.

1 Like

core-ssh:~# hassio sn list
{
“result”: “ok”,
“data”: {
“snapshots”: [
{
“slug”: “fdbd0cc3”,
“name”: “l\u00f6rdag 31 mars 2018”,
“date”: “2018-03-31T09:49:27.172052+00:00”,
“type”: “full”,
“protected”: false
},
{
“slug”: “7d4a8170”,
“name”: “torsdag 5 apr. 2018”,
“date”: “2018-04-05T10:44:31.096484+00:00”,
“type”: “full”,
“protected”: false
}
]
}
}
core-ssh:~# hassio sn restore -name fdbd0cc3

3 Likes

The CLI above, should actually read;

core-ssh:~# hassio sn restore -slug your_snapshot_slug_name

Your answers were very helpful. Only problem is when I issue the hassio sn list command, I get the following

core-ssh:~# hassio sn list
{
“result”: “ok”,
“data”: {
“snapshots”: []
}
}
indicating that there are no snapshots.
The name of the file created by the create snapshot is
Hass_io_Wednesday_Aug_22_2018.tar and length is 2370 KB
I put it in a folder called backup and also in the folder with the yaml files and stuff.
What am I missing?
Thanks

you need to do a:
hassio sn reload
to refresh the list of snapshots

Thanks, but that did not help…same results

If you don’t mind one more inquiry.
I used “hassio sn new” to create a new snapshot. It worked fine and even shows up in available snapshots .
But I cant see it anywhere on the sd card using samba. If I could find it I could put the one that I want to restore in the same place.
Thanks

in samba (I’m assuming you installed the samba addon) there will be a folder called backup

The snapshots live in the backup folder.

Make sure the options look something like this:

{
  "workgroup": "WORKGROUP",
  "name": "debian",
  "guest": false,
  "map": {
    "config": true,
    "addons": true,
    "ssl": true,
    "share": true,
    "backup": true
  },
  "username": "username",
  "password": "password",
  "interface": "",
  "allow_hosts": [
    "x.x.x.0/24",
    "172.16.0.0/12"
  ]
}

Thanks for your help. I did not see what you saw. So I messed around a lot and finally figured it out.it.
I only saw config(\HASSIO) ( Z:)
I now also see backup(\hassio) (Y:) and it contains the snapshot that I created.
So all I should have to do is move the other one into this place and go.

Huge learning curve. Thanks again
Tom

Just remember when you copy over a snapshot you need to refresh in the snapshots tab or
hassio sn reload
from ssh.