Openhab3 buster x86 -> raspberry pi bullseye+, how?

I have the latest openhab 3.4 (including influxdb/grafana/mosquitto) running on an x86 buster installation. Now I want to migrate openhab to a raspberry pi 4. Tried an old openhabian image (openhabian-pi-raspios32-202212201337) to install 3.4 on the RPi. But this loaded openhab 4.03 which does not even start.

I wanted to migrate 3.4 to the RPi so that I can better control the upgrade to 4.x. I cannot run 4.x on the x86 because buster is too old. What is the best way to migrate OH3 to the RPi ?

Thanks, Martin

The openHABian image is independent of the version of OH installed. openHABian is a bunch of scripts that set up and configure the OS to run OH and related services. It does not actually come with anything except the base Raspberry Pi OS and these scripts to install everything (including openHAB) in the normal way. If it’s an older image it is very likely not to work at all. You should always use the latest openHABian image.

The reason OH 4 didn’t start is probably because it requires Java 17 and OH 3 requires Java 11. An older openHABian wouldn’t know anything about OH 4 so it only installs Java 11.

Your best bet is probably going to:

  1. Get the latest openHABian image
  2. Once it fully starts:
  3. Stop OH and remove it using apt uninstall openhab
  4. Remove Java 17 and install Java 11 (which I think you can do through openhabian-config)
  5. Install the specific version of OH you want using sudo apt install openhab=<version> where version is going to be something like 3.4.4 I think.
  6. Fix the version so it doesn’t upgrade to the latest release version sudo apt-mark hold openhab.
  7. Restore your backup.

Oh - thanks. I will try that.

It worked basically as you explained with the following exceptions:

#3: apt uninstall openhab did not work. I used apt remove openhab

#4: openhabian-config threw an error message when switching to Java 11. Had to install Java 11 manually.

#5: Version 3.4.4 did not work. 3.4.4-1 worked

That’s what I get for going from memory.

Sure. I appreciate that you responded so fast. This way I was able to find my way.
However, as a lurker I sometimes struggle at situations like these. Any problems resulting in typos or misspellings may kick me out because I may not know the complete story behind these commands. So - again - no offense meant. Just wanted to add my 2 cents to help others.

I’m always happy to have mistakes and errors corrected. These posts stay up forever.

image

1 Like