Moving to 64bit Openhab3 in Docker

Hello!
Can anyone explain how I can migrate from 32bit to 64bit OS ?
Now I’m running OH3 Docker image and want go to OH5m1 .
Hw: Rpi 4 4GB

Reinstall. The old times of installing 32bit two times to get 64bit are long gone.

  1. Make a backup of your OH
  2. Reinstall your OS to the 64-bit version of Raspian
  3. Reinstall Docker and any other needed software
  4. Pull the image (the correct architecture will be chosen) for openHAB, make sure it’s the same version of OH as the backup
  5. Restore your backup and clear the cache (you don’t want the 32-bit jar and kar files in the userdata/cache hanging around)
  6. Start the OH container
  7. If everything works, pull the 5 image and recreate the container.
1 Like

Can you explain how do this backup ?

Presumably you have some volumes mounted into the container. That’s the officially supported way to run OH. Well, make a copy of those volumes and copy them off the machine you are about to reimage.

I just got around to updating my rpi4 from bullseye to bookworm and read this. I’m not ready yet to start playing with OH5 yet but on rpi4 where you have 32bit userspace but can run the 64bit kernel, you should be able to run the 64bit jvm or containerd so you don’t have to wipe your pi and start from scratch.

Insure you are upgraded to bookworm. The default for bookworm is arm_64bit=1, unlike bullseye where you had to explicitly set it in config.txt
Add the foreign architecture and install the real 64bit kernel, modules, libc, etc…

dpkg --add-architecture arm64
apt update
apt install linux-image-rpi-v8:arm64
reboot # this is important

Now apt-file list libc --architecture arm64 will show the libraries in /usr/lib/aarch64-linux-gnu/gconv/

Verify the following:

dpkg --print-architecture
armhf
dpkg --print-foreign-architectures
arm64

armhf is the basic architecture you carried along with you since you started out with a 32bit os.

verify that lsmod shows you have the loaded 64bit kernel modules

test installing and running a 64bit native app

apt install hello:arm64
hello
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so' from /etc/ld.so.preload cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
Hello, world!

You can ignore the error message from the preloader which is trying to preload libraries from the standard arch. It can be disabled at the expense of performance if you want to google how.

Now you can do one of 3 things: install java21 from sid (not recommended), find one of the 64 bit jvms like temurin and install it, or as you wanted you can try to install the 64bit containerd and run the 64bit jvm in that:

apt install containerd:arm64 #(you might need to remove the armhf one first)

Hopefully OH5 comes out around the same time as trixie, then openjdk-21 will be easy to install.
When I get OH5 working on my rpi4 I’ll report back just so the instructions are clear.

or simply use openHABian which has done all of this for you already ?

If you want to dedicate an entire pi then that is the way to go. I have 8GB so it’s overkill, and I need to run docker containers for eufyws, vouch-proxy, sendmail, nginx, etc… Basically I would need to get another rpi.

It’s recommended to run your home automation on a dedicated box for various reasons, it’s more reliable, less dependencies, so way less risky for just a couple of bucks.

You can however as well start with openHABian and add your programs or even add docker containers on top there.

How do I find out what I need to back-up and restore in order to upgrade without any loss of data or functionality?

I installed OpenHAB a long time ago and probably used whatever the default installation instructions are but don’t recall any details. I need to upgrade to 64-bit OS but I have not a clue what to backup.

:person_shrugging: There isn’t enough information provided to answer that question.

If you are running only openHAB on this machine, sudo openhab-cli backup will create a .zip file with everything you need to preserve and transfer for openHAB itself.

But if you have other stuff running on this machine, each needs to be backed up and restored individually and independently. How do you do that? Depends on what it is. I can’t give any more specific details.

It’s a system that runs openHABian and I use it only for that. I only care about backing up openHAB, including addons, sounds, node modules, etc. I basically want to create a backup that I can use on a new system to create a perfect clone of the old system.

Looking into this a bit more, I believe openHAB on Linux | openHAB offers some help: running /usr/share/openhab/runtime/bin/backup creates a zip file that appears to contain everything I expect to need to clone the system. I will now install openHAB on a new system and restore the zip file there to see if I can get a working copy of the original.