Copying installation from older OH to a new system

  • Platform information:
    • Hardware: Raspberry Pi 3B+
    • OS: Raspberry OS Buster
    • Java Runtime Environment: jre11
    • openHAB version: 2.5.3
  • Issue of the topic: I have sd card with Debian linux, which is nearly unrepairable (kernel is dead) but there I have a working and fully tuned installation of openHAB, a lot of add-ons, rules, PaperUI things, mySQL and more. I also have a new sd card with Raspberry OS Buster installed. The question is: how to copy all my data to a new system? Do I need the same version of OH to be installed? If so, where can I find version of installed OH on the old card, and where to find a package to install? What folders and files should be moved?
    And maybe there is a simpler way to do that?

BlockquoteJava Runtime Environment: jre11
openHAB version: Unknown

We need more information. OpenHAB 2.x needs JDK. 8 and The testing OpenHAB 3 requires JDK 11.
As I saw in another thread JRE is not sufficient.

For Raspberry Pi the OpenHABian image is highly recommended for ease of installation. It insures the proper requirements are installed.

I believe if the old is 2.5.x and the new is the same or later most things should work absent any breaking changes in the bindings.

The part of the question is how to find out what version is already installed on a non working system? I tried to find it in dpkg logs, but they rolled faaar away from that time.

I just searched because I remembered it mentioned when 2.5.1 was released.

To see the detailed version information, please have a look at userdata/etc/

openhab-distro : 2.5.3
openhab-core : 2.5.0
openhab1-addons : 1.14.0
openhab2-addons : 2.5.3
karaf : 4.2.7

So the old system was running 2.5.3. I believe 2.5.10 is current but the changes would be all in version 2 bindings. The core was frozen at 2.5.0.

Since the SD Card was going bad is is also possible any data from the card could be corrupt. That is why backups kept somewhere other than the card are highly recommended.

First I would create a list of installed packages on the old system and install these on the new system. The file /var/lib/dpkg/status helps to identify the files that are installed on the system.

OS related configuration is kept in /etc.
Once installing a new OS from scratch I always create a tar file containing the /etc folder of the old OS version. In that way I can check back what I had on the old system.

Have a look to the script openhab-cli. That script is used to create backup and restore a OH backup. This will give a clue on what to copy.

In case you can mount the old SD card and you still trust the content you can try to run openhab-cli to create a backup of the OH configuration.