Docker Raspberry Pi Migration Restore

I need assistance restoring a backup on my new raspberry pi from my old raspberry pi.

  • I know that I have to do a manual restore because this is a container install.

  • I have my data folder extracted from my backup

  • How do I get that data into /var/lib/docker/volumes/Home-Assistant/???
    I have attempted an SFTP and I am not given permission to enter /var/lib/docker
    I have also attempted to browse to /var/lib/docker/volumes/Home-Assistant/ on the Pi itself using CD and Pi OS and get the same error

Thank you in advance.

How do you launch the HA container?
A typical solution is to do a bind mount ( -v)

It’s docker or is it HAOS because that look like HAOS config location?

Docker the container folder is config

-v /folderwithfilesonyourRasPIserver:/config

I created the container in Portainer by making a volume called Home-Assistant and then mapped that volume in the container to /config

that sounds correct but not the best way to do this with docker.

docker create --restart=always  -v /etc/localtime:/etc/localtime:ro -v /srv/yourRasPifolder/config:/config -p 8123:8123 --name=homeassistant

the above should work. just create a folder and place your HA files in It. I recommend using /srv/docker/homeassistant/application/config
Lastly you will also need to make sure permissions match. I create a user and always run HA as this user but for you I would recommend just creating the empty folder and starting the HA container to allow it to create the files. After it runs, stop the container, check the files groups:owner and just make your match that. It will probably be root but this is also a good way to verify HA can function and you can access it before you add your old config.

I forget to mention that you may want to match the version of HA from the backup files you are using. You may just change the image version in the docker command to match your current.

I forgot you using portainer so you can just use the info above the create the needed folders or just command line into pi, run the command and then use portainer after that for modification as needed.

1 Like

But how did you copy your backup out of your container, then, if you didn’t use / are not aware of bind mounts?

I saved the zip file from the settings, backup page of my old pi 4 installation

I appreciate all the help from everyone. What I have tried recently is connecting an HDMI mouse and keyboard, launching the file manager as a Super User, and copying the files from my homeassistant backup tar.gz from a USB drive into /var/lib/docker/volumes/Home-Assistant/

Sadly home assistant still boots up as a new install without any of my settings present

Incorrect permissions or you missed the hidden folders, specifically “.storage”

1 Like

Another solution is docker cp

But hey, if the OP keeps banging his head against the wall trying to push files to docker volumes in unsupported ways…

It was the permissions!!! I’m up and running on my new Pi!
It certainly felt like I was banging my head against the wall, thank you everyone