Restore in openhab docker environment - how to stop openhab and restore?

Hello,

Migrating to docker image from plain ubuntu setup.

I have a backup, that was created b the backup openhab script.

I have copied it over to the userdata/backup in the openhab docker container

I exec into the container and call the restore script.

The restore script aborts, telling I need to stop openhab first.

However, how do I stop, pause or put it in whatever state to be able to restore ?

If I kill the process, the docer container stops and restarts, as expected with the config.

Any help would be apreciated !

Cheers

Robert

Ok, I needed to unpack the backup manually into the mounted openhab folders on the host, after stopping the container.

I unpacked everything in a temp directory and copied over only the following ::

userdata/persistence
userdata/jsondb

Then re-started the container and mot of the stuff worked again.

You’ve stumbled upon the process I think most of us take to restore with the Docker container.

But another approach you can take is to mount a script or scripts to /etc/cont-init.d. These scripts get executed inside the container before openHAB is started. So you could put the backup zip file somewhere and have a script which executes /openhab/runtime/bin/restore /path/to/backup.zip to restore the backup.