[SOLVED] Moving the config folder - Pi-4 running HA core in a Docker installation

I want to move my installation from the current folder to a new one.

How can I achieve that running in a Docker environment ?
Or how can I move only the fast growing database ?

I simply want to keep the installation clean on a 8 GB format cause the time for backup and restore will be a lot shorter than the same for a 16 GB card.

How can I move savely my installation from /home/pi/HomeAssitant to /home/master/HomeAssistant ?

thx

Bind mount. How are you doing it right now?

rsync -avH /home/pi/HomeAssitant /home/master/

1 Like

Thanks for your quick response ! :grinning:
to be honest I do not know cause I simply installed it as it had been described. I am using HA for 2 weeks and since then I had installed a lot, really a lot more than I had thought :+1:.
But I had issues in the past with programs continously writing data (scientific measurements) to a SD Card therefore I am asking to move the config to a SSD or fast USB stick. The last is easier to replace than a SD with OS.

Here is my install code from 10 days ago. I simply copied it and changed the foldername to HomeAssistent - nothing else.

sudo docker run --init -d \
  --name homeassistant \
  --restart=unless-stopped \
  -v /etc/localtime:/etc/localtime:ro \
  -v /home/pi/HomeAssistant:/config \
  --network=host \
  homeassistant/raspberrypi4-homeassistant:stable

I even do not know where the docker app is bound in to autostart cause I never had checked it.

My goal is a separation of the Pi IMG i create on saturday morning to be prepared if things go wrong (I have spare Pi and SD cards) to move the tear and wear that comes along with HA away from the SD card

To answer your question, delete the current container sudo docker stop homeassistant && sudo docker rm homeassistant, then re-execute the docker run with /home/pi/HomeAssistant replaced by /home/master/HomeAssistant.

1 Like

OK, there is no such config file where I just could switch from 1 to the other folder so I have to deinstall and reinstall it fully. I had hoped for an easy and afe way cause the installation will take a least an hour as it had been in the past - just 4 G network out in the woods.

I will try my best later when I am back home. thanks

I lost you. Yes there is: the docker run command you showed…
You don’t need any 4G.

Once again: I had hoped for a simple configuration file which I could edit and change old path to new path and save. Start docker and Home Assistant and everything should have been fine.

But you had told me I need to go through the whole configuration process and I guess that might take a while cause it took a while last week during installation cause I rely on 4G.

I guess you mean that removing homeassistant will remove it from the docker startup and that the “new installation process” would not require a new installation cause it will detect the old one in the new path I called :

sudo docker run --init -d \
  --name homeassistant \
  --restart=unless-stopped \
  -v /etc/localtime:/etc/localtime:ro \
  -v /home/master/HomeAssistant:/config \
  --network=host \
  homeassistant/raspberrypi4-homeassistant:stable

But I think that it is now clear for me that only “the hull” will be removed from docker and then added again but pointing to the new folder.
I had never worked with HA and Docker before I started 2 weeks ago. So I am just carefull to not delete something in a hurry that I can not get back again as easily.

Thanks a lot ! :+1: :grinning:

P.S.: My point was " delete the current container sudo docker stop homeassistant && sudo docker rm homeassistant" which sounded to me like deleted physically, not just the pointer to the installation. Therefore I thought I had do redo the installation fully.

:slight_smile:
I assumed you had basic knowledge on how docker work as you were using it :wink:

1 Like

no, zero knowledge except that install line and where I got it from and what it should do ( the 3 basic commands).

but that level is the best for the biggest progress you can achieve.
I do not know anything about the docker compose - luckily I did not need it so far cause everything I had to do till know was adding integration and make it happen to work inside docker on pi and visit mostly all of the pitfalls you wanted to avoid.

But work in progress, so things get better and Pi 4 is still doing fine.

thanks for this efficient support even though I still have to check it out if it really works but I guess so.