Restore home assistant running in docker container

Thanks, but how do we restore the files? The content of the full backup I have has several .gz, do I need to manually extract all those?

I followed the link you posed and I see the mention of backup/restore for container installation but there are no instructions on how to restore

you can restore the backup using homeassistant UI

IF you cannot do that, inside the backup there is a homeassistant.tar.gz.
Inside homeassistant.tar.gz there is ā€œ/dataā€ folder that appears to be backup of the full HA config folder
Create homeassitant container
Run homeassistant container and verify you get setup or login screen
Stop homeassistant container.
Replace current homeassistant /config folder with full contents (including hidden folders) of /data from backup
Restart homeassistant container. All should work

NOTE
Version of backup should match version of container. Do not restore config from 2022.3.1 to 2022.9.1 or even 2022.9.1 to 2022.9.3. If you want to update do that after restore. The backup is named after the version and docker tags allow you to restore specific version so it should be easy to manage.

1 Like

The container itself does not need a backup, you can pull this ā€˜anytimeā€™ from docker
The duplicati setup I have does only do backs-up for the persistent part of my containers and duplicati allows to restore single files

Hi,

Iā€™m having the same problem.
Iā€™m stuck at this part :
Replace current homeassistant /config folder with full contents (including hidden folders) of /data from backup

How you manage to do that ? Iā€™m not an expert with Docker and containers.

Nevermind, I managed to do it.
But when I log in to the interface of Home Assistant, iā€™m still welcomed by the onboarding screen, and cannot access to whatever I had configured before.
When I access the container via portainer I can see itā€™s got all my files and configurations under itā€™s config folder ā€¦

Is there something to do ?

Thankā€™s

It has config but did you open file and check the contents?

Is ā€œ.secretsā€ folder in config folder?

I think it just doesnā€™t start if file permissions are incorrect but check that.

Look at logs during start in portainer. Make sure it loads config and givs no error

EDIT

Onboarding message may be caused by missing .secrets or inability to access it

I did check whatā€™s inside the config folder and there is my custom_components, my config file refers to devices etc
I also reconfigured mqtt broker in the devices page and all my zigbees devices were automaticly configured. So I assume it has loaded my configuration but not totally.

But, I need to reconfigure lots of things that I should not have to : dashboards, persons, devices etc

I donā€™t have a .secrets folder neither in my backup folder or in my config folder.

No relevant information in portainer logs during startup

EDIT :

Ok, I managed to get it working.
In fact, I used cp command to copy my files BUT without the -R it doesnā€™t copy the hidden folders.
When I started Home Assistant container, it created the missing folders so when I checked if everything was ok, it seemed, indeed.
But, then I checked their content and compared to my backup and there were some files missing, a lot in fact.

Thankā€™s for your help and I hope it will contribute to helping others.

1 Like