[SOLVED] From RPI3+b to RPI 4

I have a complete openhabian Image containing openhab2, homebridge and some tools on my RPI 3b+.
Now I bought an RPI 4.

Is it possible just to swap the cards and the RPI 4 will boot?

The RPI4 requires Raspbian 10 which was released in the second half of last year.
I think it is unlikely to work well without some issues.

I thought the openhabian image file would be the same

Ther was actually a new one release to support the Pi 4. OpenHABian v1.5 was released on August 4 last year.

I have that 1.5 Debian Buster image completly configured on the RPI 3 and like to move now

It MAY work but I would tend to look for people on a Pi forum that have moved their card like that.
I do not know the architectural differences that require the newer OS.

Make a backup using sudo openhab-cli backup --full and move the backup to your PC or USB drive. Install a fresh image to the Pi4 and restore the backup file.
Place the backup zip file into the backups folder then:

sudo systemctl stop openhab2

openhab-cli restore /path/to/zipped/backup (var/lib/openhab2/backups)

sudo systemctl start openhab2

1 Like

Just swapped the cards from the running RPI3b+ to RPI4b and it works…
ok…the ip was different and I had to change the IP´s from amazon-dash buttons…but it worked from Openhab over homebridge till Homekit…

I advise to try it out

1 Like

That, of course, is expected with different networking hardware.

But do you have a backup (that’s been verified to work) for when the SD card fails? If not I recommend installing a fresh image and test it on your Pi3 with the backup steps I posted above.

I was looking to clean up some the mistakes I have invariably made since I bought my Rpi3 and started on Openhab. Basically I was a NOOB with both Linux and OpenHab at the time. I’m a little better now thanks to the community. Anyway I followed the steps you recommended. I was backing up a Openhab 2.5 installation with some 40 zwave nodes, 4 IP cameras and MySQL persistence. I have three problems that I am working through. First, and already solved, the Zwave needed the feature:install openhab-transport-serial command to get working. (I had the Aeotec stick on a 2.0 USB hub, as recommended elsewhere as a workaround to the issue it has with Rpi4). Second, I needed to reinstall the MySQL server and ffmpeg as they were not included in the --full backup. This could have been because of the locations I had put them in, so some people may not have these problem using the --full backup. Lastly it seems some file permissions in the fresh Openhabian 1.5 have changed from what I had, so I am having some stumbles to get the persistence and cameras working. Don’t get me wrong, I did not want to do the card swap anyway (wanted a cleaner install), but either because I had a non-compliant, but working instance, the transition did not go as smooth as I hoped (in my dreams).
Next week when the parts arrive, I plan on moving, what will hopefully be a fully working system over to a SSD on the USB 3.0 and just use the sd card for boot. As a final note Aeotec support told me they expected a RPI4 compliant Zstick by the end of March.
Update
So I thought I would add some updates in case someone else looks at this thread.

  1. I did have a significant diversion on the MySQL set-up, triggered by this message.
    mariaDB connector2
    I went ahead and installed MariaDB and followed the rest of the steps in the Tutorial, but was under the impression that this required me to use the JDBC-Maria persistence and make the necessary changes. WRONG. Basically if you had been using MySQL, keep the MySQL.cfg and MySQL.persist. No extra driver is required in the addons either. Anyway persistence is working in the Rpi4 as it was in the Rpi3.
  2. There was no problem with the camera binding after adding the binding files in the addons directory.
  3. Besides the obvious IP address changes, I needed to change the IP in my cameras (FTP binding) and in Visual Studio Code (to avoid the server shutdown error when editing Rpi4 files).
  4. After getting the USB 3.0 SATA adapter and SSD drive, I only had one problem with the process here. Do not use step 14! Instead just change the PARTUUID in the cmdline.txt. The backup SD card with the final working Rpi4 that I made prior to changing the root to SSD was a lifesaver.
    I did run the speed test from here. The new set-up is 8x faster than the SD card on the Rpi3 and with the SSD should avoid the failing SD card issue. It does seem the speed is helping with the IPcamera image captures and rule executions also.
1 Like