@aristosv wrote:
I am currently using Home Assistant core, in a docker container and I am working on a bash script that:
- Stops Home Assistant container
- Backs up all data located at /var/lib/docker/volumes/homeassistant/_data
- Deletes Home Assistant container, image & volume
- Downloads the latest Home Assistant image & installs it
- Stops Home Assistant container
- Restores backed up data to /var/lib/docker/volumes/homeassistant/_data
- Starts the Home Assistant container
Basically I am doing this with all my containers but with Home Assistant I have the following issue:
After the container is started, I am prompted to go through the on-boarding wizard again. It shouldn’t do that because all my configuration has been restored.
Any idea why?
These are my scripts for backing up and restoring all my containers.
backup containers
for containername in $(docker ps --format "{{.Names}}") do echo stopping $containername docker stop $containername > /dev/null 2>&1 echo creating $containername backup folder mkdir -p /mnt/backup/backups/containers/$(date +"%d_%m_%Y")/$containername echo backing up $containername cp -R /var/lib/docker/volumes/$containername/_data/* /mnt/backup/backups/containers/$(date +"%d_%m_%Y")/$containername echo starting $containername docker start $containername > /dev/null 2>&1 done
restore containers
for containername in $(docker ps --format "{{.Names}}") do echo stopping $containername docker stop $containername > /dev/null 2>&1 echo removing $containername configuration rm -rf /var/lib/docker/volumes/$containername/_data/* echo restoring $containername configuration cp -R /mnt/backup/backups/containers/$(date +"%d_%m_%Y")/$containername/* /var/lib/docker/volumes/$containername/_data/ echo setting $containername permissions chown -R containers:containers /var/lib/docker/volumes/$containername/_data/ echo starting $containername docker start $containername > /dev/null 2>&1 done
Posts: 3
Participants: 3