I would like to migrate my OH3 server from my Raspberry to my Synology by hosting OH3 in a docker instance, the first thing that blocks me is not being able to access through the terminal to my new instance on the Synology and therefore not being able to perform the restore backup function just created on the old machine
It’s not clear, you cannot access the terminal on the Synology? In that case a Synology forum might be a better place to ask.
If you are looking for a terminal in the Docker instance, then there really isn’t one, not through SSH the way you might be used to. A Docker container is isolated from the host machine but it is not a VM. It doesn’t have a full operating system running in there. It just has enough to run the one application in the container.
One important thing lacking is
openhab-cli. That doesn’t exist in the Docker container. But you should be able to unzip the backup and put the files where they need to go.
However, a restore from an installed OH instance to the container OH instance may not work even then because the files are in different locations. So you might run into trouble there too. But it’s worth a try. Though note that you don’t even have to access the terminal inside the container for this. You should be mounting a volume to userdata and conf already. You just need to copy the restored files in the backup to those locations on your host.
Anyway, to access a terminal running inside the Docker container use
docker exec -it openhab /bin/bash
That will open a terminal inside the running Container.
you can also use Synology’s GUI.
double click your running container, click on ‘terminal’, click on ‘create’ and you havbe a new terminal called ‘bash’
not sure if that is what might help you.
Thanks for your replies but still I could not solve it, I found this post, where they explain how to backup and how to restore it, the fact is that I don’t know how to execute these commands on docker (it’s my first time using it)
i’m pretty sure those ‘backup’ commands are only valid on an openhabian installation.
openhabian has some things build in that e.g. the docker image does not have
you can use bind mounts on docker to map /addons /conf /userdata to a folder on your synology though which is something like a ‘backup’, too
That’s kind of the main point of my reply. Those command don’t exist for Docker. You’ll have to unzip the backup and potty the files where they need to go manually.
I did the same some milestones ago.
Here is in brief what I did:
-Be sure to have both instances on the same version.
-Backup openhabian via its menu.
-Copied and extracted that backup to my PC
-Created the folders (addons, conf, userdata) needed for openHab on the Synology and copied the files from the backup over.