Migrating to a newer RasPi doesn't work

Hello,

I’ve got a new Raspi 4 (name in router: raspberrypi) on which I run a rather simple software (openwb;) and an old Raspi 3 (name in router: openhab) on which I run openhab and node-red.
At the moment the Raspi 3 seems sufficient, but in the future with additional smarthome features it might become too slow. So I’d like to switch:

  • Raspi 4 → openhab, node-red, …
  • Raspi 3 → openwb

First I thought I just needed to exchange the sd-cards but that didn’t work. So now I exchanged the ports too (Router: FritzBox 7490) so that the Raspi 3 got the former IP of the Raspi 4 and vice versa.
That’s no problem with openwb / Raspi 3, which now runs fine under the former openhab-IP. However, the Raspi 4 with openhab is not recognized in the router (and of course I can’t access openhab via browser). What I have now in the router is a few devices called “raspberrypi” which are listed as “unused connection”.

Of course, I could just revert the process (exchange SD-cards and IP-addresses) but in the long/medium run it wouldn’t work that well.
Do you have any idea what I should do/try?

Did you select statis IPs on one of the raspberrys?
Or did you tell the fritzbox to assign always the same IP to one of both?
The problem you’re facing could be cause by a IP adress conflict

Keep in mind that DHCP is based on the MAC ADress - that means changing the SD card won’t make a difference. If configured the hardware always gets the same IP assigned since the MAC does not change

Hi Sascha,
the IPs are static / I assigned them permanently.
I didn’t think about the MAC address (and don’t know much about them). So what should I do, exchange the MAC-addresses as well?

Well, the MAC is hard coded in the network chip of your RasPI. So changing the MAC is not an option.

I understand that you’ve set a static IP on the RasPI directly. So the better way would bd:
Set both systems to DHCP and let your fritz.box assign always the same IP from te DHCP pool like shown in the screenshot here:

I think you cannot just exchange the sdcards, because there are some differences between a Raspi3 and Raspi4.
See for example:
https://www.raspberrypi.org/forums/viewtopic.php?t=243520

1 Like

I hat the IP-addresses assigned like Sascha proposes from the beginning, but that leads to the problem I described / doesn’t help.
If I follow Bernd’s advice and link and consider that I’m not really familiar with Raspis and network protocols: I shouldn’t exchange the cards.

So where does that leave me?

  • Option 1: leave openhab on Raspi 3 and hope there won’t be any performance problems in the future
  • Option 2: create a new SD card. But how do I do that if I want to keep my openhab and nodered settings?

Read the documentation and search this forum.

Well, backup doesn’t seem to be so simple if you’re new to openhab and linux, if I get this (Docs on how to backup openhab) right.

So could I proceed like this?

  1. backup current system/sd card using this command:
    sudo $OPENHAB_RUNTIME/bin/backup
  2. Put a new SD-card in Raspi 4 and install openhab from scratch.
  3. finding the backup file (somewhere in the openhab- or a subfolder folder, I guess) and copy it to the new SD card
  4. enter: sudo $OPENHAB_RUNTIME/bin/restore $OPENHAB_BACKUPS/myBackup.zip

Would this work or is there a better/easier way, did I miss anything? And: will my User Interfaces and node-red-rules be available?

Thats basicly how you should be doing the backup/restoring using the backup runtime build into OH.

However, I once tried this, and though everything was restored as it should, I ran into issues when I tried entering Karaf console… Still dont know why or what happened, but it refused my login credentials.

I have no idea of you node-red rules. I doubt they´ll be backup´d.Like databases (InfluxDB and Grafana) will not get backup´d.

As for your text configuration files if any, I would suggest you do a manual backup of these (sitemaps, items, things etc).

What OS-Version are you running on your old PI3 ? If it’s not “buster” , I think you first have to upgrade from “jessie” or “stretch”.

I did the “hassle free” setup with openhab a few weeks ago. Since it includes the operating system it’s probably the latest one. But I plan to install the new card with the 'hassle free" setup again, so it should be the same operating system version and thus not be a problem (I hope).

In this case sudo openhab-cli backup and sudo openhab-cli restore should be your friends, but you have read that already.