Hello, I am a software developer but am new to HA, after getting good with Hubitat, I decided to move over to running HA (Docker) on a RPi. When I installed the Docker image, I pointed to a minimal config file as it was a new build and was not aware of what to use as a base config.
Now that I have had some time to understand the system, I am trying to do a nightly rsync to a samba share on another computer but when I pull the files, I don’t see anything related to rebuilding the HA instance from a backup.
Here are the files listed in the docker container, but there is nothing that states my current devices, plugins, integrations, dashboards, etc? Where would that data be located so I can build from a backup set?
rsync -a --recursive --progress --verbose /var/lib/docker/containers/57e62cd764b0dfb1e269b666739c610db9a2055d6747508bdbd6db5ebccf85bd/ /mnt/fileshare/
config.v2.json looks like it has some information but nothing about my current devices, etc?
I was assuming that I could do a backup and rebuild the HA docker instance from backup files?
You should have bind mounted a folder “/config” for HA docker container to utilize.
That is where HA config files reside. Inside that folder “/config/.storage” that has ui configured items, entities and other important items
You should sync all of /config and make sure you also getting .storage
Thanks @tmjpugh, so I guess there would be a default location inside docker for that if you don’t provide one. I’ll try to look for that inside the container and add it to sync.
I’m assuming that it would use that as the default container root but nothing else ever was populated there. Maybe I have permissions wrong, I am not a Unix admin by trade so it could be user error…
You should be mapping a volume with your docker run command to a persistent data folder on the host/pi for the config. Otherwise, every time you rebuild the container (which will be required when an new home assistant update comes out) your config files will not persist and will be deleted with each new container build.
Here’s how volumes and persisting data works with docker:
Docker containers by their nature are meant to be “Ethereal”, and volumes should be used to persist data, NOT finding the data within the container itself.
You should define a volume per the install documentation
You mapped one file, not the config folder, and didn’t map that to anywhere that HA cares about. That means that most of your HA config is inside the container and will be lost.
Hopefully you’ve not done anything you care about losing.
Thanks @mwav3 and @Tinkerer … I originally followed your thread that you posted here to use rsync. So what I finally did to pull the docker managed volume was to export it as tar:
Yea I have a Zigbee and Zwave dongle running on the build that is mapped to the managed volume. Probably about 30+ devices currently, gonna try and map up the snapshot and see if it will open the existing databases, config files.
If you extract and put those config files on the host pi in the /home/pi/homeassistant/config directory then use the run command above it should create a new container and use those config files to restore your previous settings.
Before removing the old container, I’d stop it and make a new container with a different name, like homeassistantnew or homeassistant2. If that works, you can delete the old container and reuse the homeassistant name.
HA docker in your case already decided to put on config since that is the entire setup. If you are running HA Supervised it will install on /usr/share/hassio