I’ve an installation in a vm image. is it possible to migrate in a docker ? I’ve a qnap nas.
thanks
I’ve an installation in a vm image. is it possible to migrate in a docker ? I’ve a qnap nas.
thanks
For HA Core itself, yes. For any add-ons, not easily.
For HA Core extract homeassistant.tar.gz
from the backup, and extract the files there to your new config folder. Point the HA Docker image at that location and you’re good.
For example, assuming you put your backup called d1234567.tar
in /docker
:
sudo mkdir /docker/homeassistant
sudo cd /docker/homeassistant
sudo tar xf ../d1234567.tar
sudo tar xf homeassistant.tar.gz
sudo rm homeassistant.tar.gz
Your Docker Compose file, in /docker
would look like:
version: '3'
services:
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
volumes:
- /docker/homeassistant/data:/config
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped
privileged: true
network_mode: host
Now you can docker compose pull && docker compose up -d
(in /docker
) and HA will start up with your old config.
I did this recently. I copied the entire contents of my config folder (including hidden folders) to my HA docker container. You’ll need to find the container equivalents for your add-ons. It’s not too bad.