Preferred way to copy existing config from OH 2.4.x to OH 2.5.9

Probably I am asking for some already existing information, but I couldn’t find it, so some pointers in the right direction are welcome.

I am about to migrate my OH 2.4.x installation, which already runs stable for quite some time :slight_smile:
to a 2.5.9 dockerized version. Configuration is mainly text file based (except some Zwave). I know there are quite some changes between 2.4 and 2.5, so there is some work involved.

What would be the preferred way to transfer everything to the 2.5, just copy the directories or do a backup on 2.4 and restore on 2.5 or is that asking fro troubles.

The most important for me is to preserve my habpanel, so how would I copy that ?

Any tips or directions would be appreciated.

– additional info –
I just created a backup in OH 2.4.3 unzied teh file and copied the contents of conf and userdata to the corresponding folders of the new dockerized version. Restarted the container, but it seems none of the
files are used. When I stop the container, empty the directory where the container data is stored and then start the container, then ‘addons’ ‘conf’ and ‘userdata’ are created by Openhab.
However when I create an habpanel and save it, create something in home builder (setting store in database) nothing happens inside the 3 directories.

Any pointers where to look ?

I can only answer for installation on windows. Done my migration today from 2.4.0 to 2.5.8

Uninstall all bindings which are migrated from 1.0 to 2.x (causes errors if not)
Uninstall all bindings which are added via C:\OpenHAB2\addons manually (causes problems if exist)
Stop OH

Backup all things via script:

robocopy C:\OpenHAB2 "%BACKUPPFAD%" /s /e /XD C:\OpenHAB2\addons C:\OpenHAB2\userdata\jsondb\backup C:\OpenHAB2\userdata\cache C:\OpenHAB2\userdata\tmp C:\OpenHAB2\runtime C:\OpenHAB2\userdata\kar
del "%BACKUPPFAD%\userdata\etc\org.apache.karaf*.*"
del "%BACKUPPFAD%\userdata\etc\all.policy"
del "%BACKUPPFAD%\userdata\etc\"
del "%BACKUPPFAD%\userdata\etc\"
del "%BACKUPPFAD%\userdata\etc\"
del "%BACKUPPFAD%\userdata\etc\"
del "%BACKUPPFAD%\userdata\etc\"
del "%BACKUPPFAD%\userdata\etc\"
del "%BACKUPPFAD%\userdata\etc\"
REM del "%BACKUPPFAD%\userdata\etc\org.openhab.addons.cfg"
del "%BACKUPPFAD%\userdata\etc\org.ops4j.pax.url.mvn.cfg"
del "%BACKUPPFAD%\userdata\etc\"
del "%BACKUPPFAD%\userdata\etc\profile.cfg"
del "%BACKUPPFAD%\userdata\etc\"
del "%BACKUPPFAD%\userdata\etc\"
del "%BACKUPPFAD%\userdata\etc\"

Delete OH-folder and restore from backup onyl what is backuped
Delete all jar-files in C:\OpenHAB2\addons

Install new version without overright files.

Start OH and wait 10min. Everthings should be started then

Install all 2.0 bindings which were replaced from 1.0
Install all bindings which are former in C:\OpenHAB2\addons as additional bindings (shoul be now in the normal bindings in paperUI)

I run into a problem with mapdb. This persistance servers was not able to start. It looks like some items were bad. I had to delete all mapdb persistance variables by deleted the mapdb-files. With a totally empty one, mapdb starts. Then it was a hard work to restore all needed items manually

But now it works and it looks good. I’m on 2.5.8 for 6h now.

Thanks for the reply. The trick is to wait until the new OH is started and then copy the “old” userdata to the new install. I could not use your script, since I am using Linux, but did the copy manually.
Copied the following files to the new install:



  • Folders which did not contain any config are not listed here
  • Several folders inside userdata/config contained an absolute path to /var/lib/openhab, which does not exist in the Docker container. That’s why only config/org/openhab/* was copied.

Although still a few things todo, it seems to run ok now :slight_smile:

I would have used openhab-cli backup, read this Thread