Migrate from Docker to HAOS and keep history?

I’ve been running Home Assistant in a Docker setup (my own making, I think) since November 2021. I think I’m going to migrate to a VM running HAOS. I am hoping folks here will confirm some of my assumptions.

I recently bought a Home Assistant Voice Preview Edition device and I’m struggling to add in all the right containers I need (e.g., whisper, piper, openwakeword, satellite, esphome). I’m ready to give up and switch to HAOS. It sounds like if I just do that, the voice assistant will poof! magically work. (correct me if I’m wrong)

I have 4 containers in my setup: home assistant, mqtt, appdaemon, and mariadb. I think I only have concerns about one of them. Check my reasoning. The new HAOS VM will have MQTT and I just change all my devices (all eleventy billion of them) to point to the IP of the HAOS VM. Right? Nothing else to do? I could also leave the old MQTT container running where it is, and just have the HAOS VM use it.

I don’t need to worry about homeassistant itself, because I will use HA backup and restore. Though I do have a handful of things manually added to the config file (app keys for pulling calendars off nextcloud). I have a handful of hand modified JS files and lovelace things that I’ve had for ages. I can probably leave those behind or figure out how to move them. I’m not too worried about this part.

The Appdaemon container runs to host my NsPanel displays. I think I can leave that as a container on my container host, and just point it to the new HA VM. It doesn’t need to run on the HAOS VM.

This leaves Mariadb, which is the one container that gives me pause. It looks easy enough to install Mariadb into HAOS. My question is that I have over a million rows of stats. Does it matter? Am I losing something if I don’t migrate this data? Is it possible to migrate this data? Is it worthwhile?

I’m not scared of mariadb-dump and migrating the data. I just can’t tell if this data is doing anything good for me, or if it’s just taking up space. I can leave the old database online after I create the new VM. I can migrate later. I’m in no rush to shut it down or reclaim the space. Am I going to actually make things worse for myself by migrating old data? Will it just muck up all the displays having prior history from a different system?

What should I do about all the data in Mariadb?

That’s a question only you can answer. How important is the history data to you?

Do you mind starting again with a blank slate, no energy or other state history?

If you do want to keep it then you have a couple of options,

  1. Leave the MariaDB instance online and point your Home Assistant recorder to it. Or

  2. Install the MariaDB addon and move your databases to that container. This may be easier said than done.

If you don’t mind starting with no history then using HA OS with the default recorder (SQLite) will be fine.

As usual, I was overthinking it. You helped me see that. Thanks.

I stopped the homeassistant docker container. I built a VM running HAOS. I have a TrueNAS SCALE system and I followed these instructions to launch HAOS in a VM under TrueNAS. I restored the backup to the VM and poof! It worked.

I left MariaDB and MQTT running in the containers as they always were. No reason not to.

That meant the only big change was the IP address of home assistant. So I had a handful of configurations to change.

  • I had to change HomeAssistant’s MQTT integration to point at a different IP address (HAOS VM is not on the container network, so it can’t reach it by those internal names/IPs)
  • I had to edit the recorder section of my configuration.yaml to point to a different IP address for the database server
  • I have an ecowitt device and I had to tell it to start sending data to the new IP address

This was about as painless as it could be. I’m an old “here’s a nickel kid, get yourself a better computer” unix guy (you have to be old enough to get that joke). I kept scratching my head like “that’s it? It is just working?”

HomeAssistant has come such a long way and is such a polished experience these days.

2 Likes