Docker Install Migration on Ubuntu

As I had Ubuntu install already running and being docker novice I thought it would be a good opportunity to learn docker a bit and home assistant so I installed the docker version a couple of weeks ago. Things are going ok and I have it showing various bits of my smart home kit but kept running into a bit of a brick wall because most online help keeps referring to addons and supervisor. After some major reading I get why it’s now not supported on my docker install so I started to work the issue go with the flow and accept I need to add more dockers (helps me be less of a docker novice or at least that was the hope).

Anyway after more reading discovered portainer and docker-compose and I like it but as my original docker preceded that I wasn’t expecting it to show up in portainer but much to my surprise it does… sort of. Unfortunately it appears despite telling the original docker install where to put the config files (at least I thought that was what I did) I can’t find anything like a configuration.yaml anywhere.

Anyway long story short I figured I could re-install the docker version using docker-compose and copy my config backups into it. Oh boy it is not that simple. Everything I heave read says I need to stop HA so I can backup the config or it will get corrupted. I must be misunderstanding as the only place I can find any config is inside the docker container but if I stop it I can’t get at it to copy it…

Anyone know how I can get a backup of my config that I can use to import into the new install once I do that? I know I could start again and it wouldn’t take too long to do it but that kind of smacks of admitting defeat and letting the computer beat me :slight_smile:

Look at “communes” in portainer to find /config folder location

Copy that folder along with the hidden folders it contains to the location you want

You need to stop container mostly because you cannnot have to docker container looking at same non static files (like database files), for media and documents it’s ok

Communes? Don’t think I have seen that in portainer. Do you mean volumes? If so I have looked at the HA container in portainer and the volumes has a single entry

Host/volume                                       Path in container
/PATH_TO_YOUR_CONFIG              /opt/home-ass-config

which is where I told the docker install of HA to put the config but there is nothing in that folder.

Thanks for you input tmjpugh I think I know what I have done now.

For anyone else that comes across this and makes the same newbie mistake as me here is what caused the issue.

I ran the docker container with the following command:

sudo docker run -d --name homeassistant --privileged --restart=unless-stopped -e TZ=GB -v /PATH_TO_YOUR_CONFIG:/opt/home-ass-config --network=host ghcr.io/home-assistant/home-assistant:stable

the mistake I made is probably obvious to none docker newbies like me but I put the path where I wanted the config files on the wrong side of the colon here

/PATH_TO_YOUR_CONFIG:/opt/home-ass-config

when it should have been

/opt/home-ass-config:/config

I just re ran it correctly adding a 2nd HA docker called homeassistant2 with the correct -v part and it worked.

Looks like I need to backup what I can and scrap that first try and re-do things. Ah well I wanted to learn docker and I am certainly accomplishing that I think.

Volumes

Look like you got it :smile: