Migrate OH3 from Pi4 to Pi4 in a docker

Hi all,
OH3 on my Pi4 with a SSD is running perfect and I build a nice Sematic model. So I spend quite a lot of time into the system. My next step was to create a complete backup of the system, configuration and data but that seems a cumbersome process according
[How to backup your openHABian server using Amanda | openHAB](https://OH3 backup)
To what I can find on the internet it seems that this is much easier if I install OH3 on the Pi4 via Docker with from the IoTstack project of Graham Garner and Andrea Spiess
https://www.youtube.com/watch?v=a6mjt8tWUws&ab_channel=AndreasSpiess
https://www.youtube.com/watch?v=5a2qhKMetGU&ab_channel=OneMarcFifty
so I now want to switch to this IOTstack on my Pi4. Meaning

  1. copy my Sematic model and settings
  2. earase all on the Pi4
  3. Install Rasbian (and update)
  4. Install IOTstack (with dockers like Openhab, Grafana, nodered, Influxdb,….)
  5. Start Openhab in the docker
  6. Copy the Sematic model and settings to this docker
    Question: how can I do the steps 1 and 6?

Not really. They are two orthagonal things.

Amanda is whole disk backup. It backs up your entire system from the home folders to any databases that may be in use and anything else that may be installed and configured on the machine. Moving OH to a Docker container isn’t going to do anything to make that easier. I’m doubtful that IOStack makes this much easier either.

On-the-other-hand, if all you care about is backing up just the openHAB configuration, sudo openhab-cli backup will grab all the openHAB configs you have created for you in one go. From a backup perspective all that running OH in Docker is going to change is the command you issue to create the backup (tar xvfz openhab-backup.tgs /path/to/mounted/volumes).

In short, this looks a whole lot of work and added complexity and it doesn’t even solve the original problem. Having said that:

1 sudo openhab-cli backup

6 You won’t have openhab-cli any more since you are running in Docker so you have to unzip the zip file backup created on the new machine. Copy the stuff under conf to the folder mounted to the container under /openhab/conf and the stuff under userdata to the folder mounted to the container under /openhab/userdata.

If the whole idea of mounting folders to the container doesn’t make sense to you, I strongly suggest doing some research on Docker and how Docker works. It’s not always straight forward for those who don’t understand it.

Thanks for the clear explanation and I can understand that for OH3 the current setup is the best way forward. But if we take in account all other applications like Grafana, nodered, influxDB, and all others for now and in the future.
What is in your opinion then the best way forward?

If you want to back up everything you have two choices:

  1. Back up the whole machine which takes you right back to Amanda.

  2. Back up each one individually, which is usually no more difficult to do for an individual service installed than it is for an individual service running in Docker. You just need to identify the right folder to save.

There are a lot of reasons to run stuff in containers. Ease of backup really isn’t one of them.

Thanks, convinced :blush: I keep my current setup and dive into the “standard” backup with Amanda. :+1: