Trying to run before I can crawl? Attempt to port HA from Rpi to Docker on Ubuntu

My main use of Home Assistant - and I am both grateful and in awe of the persons designing and developing this! - is to monitor a ground source heat pump. However, I have added a few sensors and the like along the way but nothing too clever regarding automations.

As I need to see any effects of changes to the heat pump, I hang on to many months of history. This has caused numerous problems including corrupting SD cards. I also moved the database to mySql to improve performance.

With a minimal knowledge of Unix and nothing on Docker, I decided to install Ubuntu on an older Samsung laptop as it automatically installed Windows 10 at some point and just gave hassle.

Every few weeks I end up bouncing the Rpi and occasionally dropping the database and recreating it so I thought a new installation would help matters. As the programs for the heat pump talk via MQTT then that should not be a problem - just point it at the Ubuntu broker.

Looking at recent articles on Ubuntu installation, I decided to stick HA in a Docker container even though I did not know what one was! Bit daft, I know! It is up and running - albeit without the “supervised” part I was expecting - and I have installed Portainer to attempt to manage Docker.

As I need to transfer the original configuration.yaml file to the new system, I went looking for it. Found it here:

/var/lib/docker/overlay2/456356bb2d6fe60d2d0b2c113ff38b6addbf39297cf6c10d03566dadbd36b226/merged/config/configuration.yaml

It worries me that if I use FileZilla to download that and tweak it then return it to the container, Docker may get upset!

I note too that the supervised version of HA could give me a snapshot I could use to transfer the config. I seem to have missed a trick here.

I would be very grateful if someone could point me to a way to transfer the yaml file - chunk of which looks like this:

sensor 1:
  - platform: mqtt
    state_topic: "heatpump/0001"
    name: "GT01 - Rad Return"
    unit_of_measurement: "c"
  - platform: mqtt
    state_topic: "heatpump/0F61"
    name: "GT01 - Rad Return On"
    unit_of_measurement: "c"
  - platform: mqtt
    state_topic: "heatpump/0F64"
    name: "GT01 - Rad Return Off"
    unit_of_measurement: "c"

Have I bitten off more than I can chew? I would rather not delve into the internals of Docker as I am getting on a bit and, although having decades of IT support experience, it has mainly been on OpenVMS!

Any pointers - even to a specific part in a Docker manual - would be gratefully received!

Thank you for keep up this brilliant work.

Actually, just placed that strange Docker directory name into FileZilla but it resulted in protection problem in any case. I shall move the config file to my home dir and try that way.

Please try


/usr/share/hassio/homeassistant/

Nope - as expected it is under the Docker container directory:

[email protected]:~$ cd /usr/share/hassio/homeassistant/
-bash: cd: /usr/share/hassio/homeassistant/: No such file or directory

Basically, I have made this a bit more complex than it should have been. I have been looking at setting up Mosquitto broker on the system to receive the messages from the Rpi except cannot fathom how to include that in the bloody container! (I have much experience of messaging systems with IBM’s MQ so am comfortable with that technology! This combination has confused the crap out of me though!)

Oh, and if this lot comes back up after I bounce the system, I shall be pleasantly surprised!

I‘m running Supervised in Docker on a Debian installation, so the path may differ. Did you search with

find / -iname configuration.yaml

?

The easiest migration for me was to an Intel NUC. I’ve always used the Supervisor and snapshots so I don’t know any other way to migrate. Just make a snapshot on the old system then restore it on the new one.

Didn’t you define a config volume for it when you ran the docker image?
Note that a supervised install isn’t supported in Ubuntu - only Debian

I’m running on Ubuntu and this are my path’s. Hope it can help you…

Don’t. Just install it on the host operating system, takes about 10s, then edit the server.conf config file for authentication, and add the user. If you have the instructions before hand, installing and configuring it takes less that 1 minute.

I ran some script which produced these:

I shall just install MQTT at the OS level and see how to get the containerised HA to talk with it.

How did you get that table? I have looked everywhere in Portainer.

I shall do some reading on Docker terminology! Thanks for the pointers.

Something similar but here is the output for that command:

[email protected]:~$ sudo find / -iname configuration.yaml
[sudo] password for gerald:
find: ‘/run/user/1000/doc’: Permission denied
find: ‘/run/user/1000/gvfs’: Permission denied
/var/lib/docker/overlay2/456356bb2d6fe60d2d0b2c113ff38b6addbf39297cf6c10d03566dadbd36b226/diff/config/configuration.yaml
/var/lib/docker/overlay2/456356bb2d6fe60d2d0b2c113ff38b6addbf39297cf6c10d03566dadbd36b226/merged/config/configuration.yaml

This is what I am hoping to port across and the ability to hang on to a few months of metrics. Every week or so the Rpi becomes unresponsive - even to SSH access. Then I have to power it off. I think there is then a chance of disk corruption (it boots off sd card but all other files are on USB hard drive). It then requires some commands to clear the corruption. Also, there is an occasional foreign constraint error in the database.

Thank you all for your comments. The support for this software is why I perservere with it even though my technical skills are somewhat lacking!

container details of homeassistant container. then scroll down.

I get this. Sorry if I have misinterpreted or just should have read more!..

I hope, you will figure it out. Unfortunately, i’m not able to help more, as i’m also a noob in Linux. I’m just good in following guides exactly, so i get everything working. But troubleshooting is not in my competences :wink:

Wish you luck :wink:

I‘m a little bit at lost. Your raspi is still running, right? Isn‘t there no possibility to take a backup?