Has anyone attempted or had any experience moving from HA Supervised over to a Docker based installation?
I currently have these addons that I feel I need to move over to their own Docker based versions and connect my HA to use those standalone Docker versions prior to backing up the HA Supervised install and attempting to restore it on a fresh HA Docker installation.
You will be doing a lot of manual backup and restoring. You cannot (easily to my knowledge at least) backup a HA Supervised install and then restore it to HA Container.
MariaDB, InfluxDB, ESPHome, and MQTT Broker (Mosquitto) can all be run in separate containers and integrated into HA. ESPHome itself doesn’t actually integrate into HA, it runs standalone while all nodes running ESPHome compiled software are what actually gets integrated into HA. I have no knowledge of Node-Red but I’m sure it’s a similar separate container install and setup like the others. MariaDB you should be able to export the database from the addon, then restore it to the external MariaDB container.
Once you have your containers setup, make a backup of your HA Supervised install and backup your configuration directory of HA (including the .storage folder and everything referenced by your configuration.yaml). You can test your external containers are setup properly before migrating by shutting down and removing the addons, then configuring HA to point to the external containers.
Of course this is all theory. You’ll have to do some reading on how to actually move things over.
I just did the “migration” to a mosquitto broker in a separate Docker container yesterday. Well, it is not a migration, it is a fresh install of a mosuitto mqtt broker and connect it to home assistant. Then you have to re-configure all your IoT-devices to use the new broker. With my 4 mqtt-based devices, quick and easy.
I had the following sources to get the mosquitto broker up and running:
The following config is running for 24h now. No issues so far.
# version: as of January 2023, https://docs.docker.com/compose/compose-file/
services:
mosquitto:
image: eclipse-mosquitto:openssl
networks:
ipvlan70:
ipv4_address: 192.168.70.4
volumes:
- /home/uadmin/Docker/mosquitto/config:/mosquitto/config
- /home/uadmin/Docker/mosquitto/data:/mosquitto/data
- /home/uadmin/Docker/mosquitto/log:/mosquitto/log
restart: unless-stopped
# mosquitto port specifications: https://test.mosquitto.org/ bzw. https://de.wikipedia.org/wiki/MQTT
ports:
- target: 1883
host_ip: 0.0.0.0
published: 1883
mode: host
# Volumes for persisting data
volumes:
config:
driver: local
data:
driver: local
log:
driver: local
# Network specifications
networks:
ipvlan70:
external: true
→ Change the network according to your needs
# mosquitto.conf (see man mosquitto.conf(5) https://mosquitto.org/man/mosquitto-conf-5.html
#############################################################################
#
# GENERAL SETTINGS
#
#############################################################################
# Allow for future listeners not related to main one
# per_listener_settings true
#############################################################################
#
# PROTOCOL / TROUGHPUT / PERFORMANCE
#
#############################################################################
# How much memmory we will allocate (MAX)
# 128MB = 134217728 byte
# 256MB = 268435456 byte
memory_limit 268435456
# mqtt v5 max keepalive
max_keepalive 7200
# mqtt v5 max packet
max_packet_size 65535
message_size_limit 65535
# Expire persistent clients that have not appeared for so much time
persistent_client_expiration 3d
#############################################################################
#
# PERSISTENCE
#
#############################################################################
# Should we even save
persistence true
# Where we save stuff
persistence_location /mosquitto/data
# Treat next settings as number of changes (if true) or seconds otherwise
autosave_on_changes true
# How often to save DB
autosave_interval 600
#############################################################################
#
# LOGGING
#
#############################################################################
# Set the format of the log timestamp.
log_timestamp_format %Y-%m-%dT%H:%M:%S
# What to log
log_type error
log_type warning
log_type notice
log_type information
# do not log to file ... we are in docker
log_dest file /mosquitto/log/mosquitto.log
# and stdout
#log_dest stdout
#############################################################################
#
# LISTENERS
#
#############################################################################
# Listen for incoming network connection on the specified port.
listener 1883
#############################################################################
#
# Password File
#
#############################################################################
# Set the path to a password file
password_file /mosquitto/config/pwfile
#allow_anonymous true
I bite the bullet and migrated from supervised to docker. I done a fresh install, paired again all zigbee devices, took some automations and settings from old system and that was it.
I done it because I wanted more controll over my containers and that I got.
So far didn’t regret it.
Update for any future searches. I was able to migrate both Zigbee2MQTT and ESPHome out of supervisor addons and into new docker containers. They both digested their previous config directories just fine after I copy and moved them around. HA also digested a copy of the previous homeassistant directory without issue. The only snag I had was with SSL certs. After some volume mapping with docker that wasn’t a problem. One of my HACS integrations is all of a sudden having problems, but everything seems to be working just fine.
Hey! I’ve already Migrated ESPHome too! But I’m too afraid to migrate all my Zigbee devices. You said you’ve managed to migrate Zigbee2MQTT do you actually remember how you did it? Did you had to repair all the devices? Hope you can help
My migration didn’t even feel like a migration. I dug up the zigbee2mqtt config directory, copy and pasted somewhere that I can reference to as the /app/data volume in my docker compose file. My Zigbee stick is actually a networked serial device and I just needed to make sure that the docker container could hit it on my local network. Once the container was rebuilt I went to the admin URL and everything eventually appeared online, no special tricks or anything.