Upgrade from OH2.5.12 to OH3.4.2 (Raspberry 3+ to Raspberry Pi 4+)

Hello,
this is the time to upgrade my openhabian to OH3.

  • I run at the moment stable Oh2.5.12 on raspberry pi 3+ with the AEOTEC USB Z-Wave stick
  • I have arround 30 ZWave components working properly
  • I use Grafana and InfluxDB
  • I have nice working MatrixTheme as HABPanel
  • I run several scripts and cron jobs
  • myOpenHAB works nice and have access from the openHAB app

A target is to move everything to the new raspberry pi 4+ with the fresh Openhabian 3.4.2

Before I touch the running system, I wish to consult my approach and check if it is OK or requires corrections.

This is how I would approach the upgrade.

  1. Backup AEOTEC Stick
  2. Backup existing openhab 2.5 by running sudo openhabian-config - 50/50

  1. Install and initial set up openhabian 3.4.2 (https://www.openhab.org/download/) on a new Raspberry Pi

  2. Disconnect old raspberry pi from network

  3. Connect USB ZWave Stick to the new Pi

  4. Run the new OH3 System with the new SD Card

  5. Restore previously backed up oh2 with sudo openhabian-config - 50/51

  6. Check if runs and configure new OH3 login panel

I assume

  • all zwave devices will be discovered and working properly
  • all cron jobs and rules will remain untouched and will work
  • I will have to establish myopenhab account and dashboard newly
  • I will need to fight with the Grafana and InfluxDB install them new (?)

Please let me know if this approach would work and eventually how to smoothly upgrade to the new OH3

Appreciate your support on that!

I’ll follow along, I’m about to do the same thing.
What’s confuse me is the Backup of all my Things in 2.5, a backup for me is the system right?
If I restore my backup… won’t I reload all my 2.5 system?
Pascal

What’s confuse me is the Backup of all my Things in 2.5, a backup for me is the system right?

I hope with the backup through the openhabian-config I will save all of my things, bindings, items etc.Everything above the physical layer.

A good idea but not strictly necessary. Moving the stick from one machine to the next is low risk.

Note this only captures the OH configs. It does not capture the Grafana and InfluxDB configs and data.

No, you can only restore a config to the same version of OH. So initially install 2.5, restore, then upgrade to 3.4.

Note, you’re looking at over two years worth of development on OH. You will have to make changes to your config after the upgrade. There were many breaking changes.

Yes, most of the information is on the stick itself. However, if you need to delete and recreate the Things for some reason, make note of the inclusion security key and set it to the same or else you’ll need to securely reinclude your devices that were securely included in the first place.

No, any changes you’ve made to the system outside of openHAB is not captured given the steps you’ve outlined above. You’ll have to move those over yourself.

No, that’s part of the openHAB config that was captured in the backup.

Probably, but there are options in openHABian for that. But you’ll lose all your old data and configs. If you want to keep those you’ll have to look at how to do that for those services specifically.

Most who migrated successfully even between 2.5 to 3.0 ended up doing it little by little instead of all at once. In the long run, you will probably have an easier time of it and spend less time in the long run if you move things over to the new RPi little by little. It’s a whole lot easier to debug a single binding or a single rule than everything going wrong all at once.

It probably too late to consider but OH3 has the remote server option that allows for the suggested approach. Basically 1) install a fresh OH3 on the Rpi4. 2) Install the remote server binding to the 2.5 instance 3) copy all the items exactly from the 2.5.12 instance to the 3.4.2 instance. 4) link all the remote server channels to the OH3.4.2 items. Now you have two nearly identical instances. At your convenience you can set up charts, and familiarize yourself with OH3, migrate rules (only have one running at the same time), set-up persistence, etc. Once you are satisfied you can move the z-stick as described above to the new instance. You will have to link all the channels of the OH3 things and remove the remote server links.

For me, I originally intended to retire the RPi3, but now have both running at opposite corners of the house for zwave responsiveness (and some testing). Did buy a new zstick. All the rules, cameras binding, charts and 35+ zwave nodes are on the Rpi4. I almost exclusively use the Rpi4 UI. The Rpi3 just has about 25 zwave nodes connected via the remote server (but I did upgrade to 3.x along the way)

I want to jump in here.

I’m on OH 2.5.12 too. As I understood it is not possible to backup OH 2.5.12 install OH 3.4.2 and restore the data. Only way to update is an inplace update using the normal update method for Linux or Windows.

If I do that inplace update:
I need to update java to version 11.
I need to fix breaking changes in DSL rules (mostly the date/time syntax change)
All former installed bindings will be installed automatically and existing config of each binding will be used
All things definition should be there after update?
This means z-ware things definition are there too and no need to enter security key for USB-Stick again?
All configuration made inside of the z-ware things are there again (configuration parameters, device command poll period, …)

Sorry for asking this, at the moment I have a very stable OH 2.5.12 and need to update due to new z-ware devices not supported by 2.5.12.

Hmm, sounds complicated anyway. If I could compromise on HABPanel and my Matrix Theme and take Grafana and InfluxDB out of the scope… than

If I could

  1. keep OH2 running on the old RPi
  2. establish completely new Openhab server on RPi4 (from scratch)
  3. switch Aeotec Zwave Stick between Oh2 and Oh3 (for stepwise migration process)

would all stored Things be recognised in a new OH3? I assume yes.

in this case i could:

  • Create a new haus structure (map)
  • Assign recognised things to the new haus structure
  • Create/copy all necessary/old rules
  • slowly bring up a new OH3 on the RPi4

It would have few advantages (beside learning experience), i could have clear, nice ready for further development home automation system.

Working with OH3 and than switching ZWave Stick between OH2 and OH3 shall not disturb running OH2 system right?
I can always come back to OH2 with the stick and everything works, fine. Or is there anything in the configuration of the Oh3 that would influence ZWave network and missfunction the OH2 system?

Unless you have 1.x version bindings in which case you’ll need to migrate those configs to the 2.x/3.x version of the binding that uses Things.

Yes, but check the breaking changes for each individual binding. Some require the deletion and recreation of Things.

Correct, unless you need to recreate those Things. I don’t remember if that was one of the bindings that required that. It’s been over two years since I migrated and even now I’m already on OH 4.

Yes, same as above.

I don’t know what this means.

I’ll say it again. You cannot restore a 2.5 backup on a 3.x server. So what “stored Things” are you talking about here?

Note, the vast majority of Things are automatically discovered and created. So it’s often easiest to just rediscover the Things on the new OH 3 instance than it is to try to copy from the 2.5 to the 3.x. In the rest of the case, check the breaking changes for the binding in question to see if the old Things are compatible with OH 3. Or just recreate those Things in OH 3.

Well, you probably don’t want to yank the stick from OH 2 while OH 2 is running. But otherwise, those Things will just be OFFLINE in 2.5 when the stick isn’t present. Nothing gets changed on the stick by the binding as far as I know.

I was not precise. “stored things” I ment all of the z-wave components in 2.5 system. Since they are “stored” on the ZWave stick the new OH3 shall see them when the stick is connected to the new RPi.

So when I configure fresh and new PRi with Oh3 and connect my Zwave USB stick (controller), openhabian will see them on the list. I can add one after another and configure step-wise new OH3.
Any time i can shutdown RP4 and connect ZWave controller back to the old Oh2 having full functionality.

If it is so. This would be a solution for me.
.

Things are a concept that only exists in openHAB. There is no such thing as a Thing in Zwave. The Zwave controller stores a bunch of information about the Zwave network and it’s nodes and when auto-discovery takes place, OH creates Things based on that information.

Yes.

Thank you for the explanation! Yes you are right, I had used a wrong language but meant the same.

Let me try this step-wise approach to bring the new OH3 up to speed.

ahhhh! First problems.
I use AEOTEC USB Z-wave stick 5Gen and it is not being recognised by the OH3 on RPi 4. I read this post and find out there are problems with the compatibility

it is not even recognised after connecting to the usb slot so i assume it needs to be connected over the hub. I do not want to go this way. It means I have to migrate with every singe z-wave node to the new system. :frowning:

How you plug in the zwave controller changes nothing. Either you’d have to do this anyway no matter what, or you never have to. All the USB hub provides is cleaner power to the controller.

I am afraid your are right. I do not want to have usb hub as of now. for me it is important to have clean, stable and reliable home automation system. With OH2 I have been learning. With OH3 I need to clean up this what was not properly done before.
I created new post to gather user experience.

Your option are:

  • Fix your Z-Wave stick (Aeotec Z-Stick Gen5 Raspberry Pi4 Mod - olausson.de).
  • Use a hub.
  • Replace your Z-Wave controller (note that series 700 Z-Wave controllers are not supported by the Z-Wave Binding, series 700 Z-Wave devices (i.e. non-controllers) are supported).

thanks for the warning. The list has been just reduced. The tip with the resistor is worth to try.
Thanks for the link

I try to bring the z-wave stick to alive with the usb hub.

  1. Connect USB Hub - the stick was able to be recognised
openhabian@oh3:~ $ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 0658:0200 Sigma Designs, Inc. Aeotec Z-Stick Gen5 (ZW090) - UZB
Bus 001 Device 003: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
openhabian@oh3:~ $ dmesg | grep tty
[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=0 bcm2708_fb.fbheight=0 bcm2708_fb.fbdepth=16 bcm2708_fb.fbswap=1 smsc95xx.macaddr=DC:A6:32:77:8E:67 vc_mem.mem_base=0x3f000000 vc_mem.mem_size=0x3f600000  console=ttyS0,115200 console=tty1 root=PARTUUID=b1c15527-02 rootfstype=ext4 fsck.repair=yes rootwait
[    0.001060] printk: console [tty1] enabled
[    1.589956] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 32, base_baud = 0) is a PL011 rev2
[    3.347625] systemd[1]: Created slice system-getty.slice.
[  291.862010] cdc_acm 1-1.3.1:1.0: ttyACM0: USB ACM device

  1. Initialising of the zwave controller was not successful

2023-03-10 21:20:06.010 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'zwave:serial_zstick:616a0823fc' changed from OFFLINE (BRIDGE_OFFLINE): Controller is offline to UNINITIALIZED
2023-03-10 21:20:06.304 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'zwave:serial_zstick:616a0823fc' changed from UNINITIALIZED to UNINITIALIZED (DISABLED)
==> /var/log/openhab/openhab.log <==
2023-03-10 21:20:08.189 [DEBUG] [wave.discovery.ZWaveDiscoveryService] - Creating ZWave discovery service for zwave:serial_zstick:616a0823fc with scan time of 60
2023-03-10 21:20:08.191 [DEBUG] [wave.discovery.ZWaveDiscoveryService] - ZWave discovery: Active zwave:serial_zstick:616a0823fc
2023-03-10 21:20:08.193 [INFO ] [zwave.handler.ZWaveControllerHandler] - Attempting to add listener when controller is null
2023-03-10 21:20:08.253 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - Initializing ZWave serial controller.
2023-03-10 21:20:08.254 [DEBUG] [zwave.handler.ZWaveControllerHandler] - Initializing ZWave Controller zwave:serial_zstick:616a0823fc.
==> /var/log/openhab/events.log <==
2023-03-10 21:20:08.241 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'zwave:serial_zstick:616a0823fc' changed from UNINITIALIZED (DISABLED) to INITIALIZING
2023-03-10 21:20:08.257 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'zwave:serial_zstick:616a0823fc' changed from INITIALIZING to OFFLINE (BRIDGE_OFFLINE): Controller is offline
2023-03-10 21:20:12.223 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'RaspberryPiSystem_Cpu_Load' changed from 0.9 % to 1.8 %
==> /var/log/openhab/openhab.log <==
2023-03-10 21:20:13.258 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - Connecting to serial port '/dev/ttyAMA0'
2023-03-10 21:20:13.267 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - Starting receive thread
2023-03-10 21:20:13.270 [DEBUG] [WaveSerialHandler$ZWaveReceiveThread] - Starting ZWave thread: Receive
2023-03-10 21:20:13.272 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - Serial port is initialized
2023-03-10 21:20:13.275 [DEBUG] [zwave.handler.ZWaveControllerHandler] - Initialising ZWave controller
2023-03-10 21:20:13.279 [INFO ] [ve.internal.protocol.ZWaveController] - Starting ZWave controller
2023-03-10 21:20:13.279 [DEBUG] [nal.protocol.ZWaveTransactionManager] - ZWaveReceiveThread queue empty
2023-03-10 21:20:13.281 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Transaction SendNextMessage 0 out at start. Holdoff false.
2023-03-10 21:20:13.281 [INFO ] [ve.internal.protocol.ZWaveController] - ZWave timeout is set to 5000ms. Soft reset is false.
2023-03-10 21:20:13.284 [DEBUG] [ve.internal.protocol.ZWaveController] - Event listener added.
2023-03-10 21:20:13.287 [DEBUG] [ve.internal.protocol.ZWaveController] - Event listener added.
2023-03-10 21:20:13.289 [DEBUG] [zwave.handler.ZWaveControllerHandler] - Scheduling network mesh heal for 5 hours time.
2023-03-10 21:20:16.283 [DEBUG] [.ZWaveController$InitializeDelayTask] - Initialising network
2023-03-10 21:20:16.287 [DEBUG] [nal.protocol.ZWaveTransactionManager] - NODE 255: Added 5 to queue - size 1
2023-03-10 21:20:16.289 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Transaction SendNextMessage 0 out at start. Holdoff false.
2023-03-10 21:20:16.292 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 03 00 15 E9 
2023-03-10 21:20:16.294 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - NODE 255: Sending REQUEST Message = 01 03 00 15 E9 
2023-03-10 21:20:16.297 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - Message SENT
2023-03-10 21:20:16.300 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Transaction SendNextMessage started: TID 5: [WAIT_RESPONSE] priority=Controller, requiresResponse=true, callback: 0
2023-03-10 21:20:16.302 [DEBUG] [nal.protocol.ZWaveTransactionManager] - NODE 255: Added 6 to queue - size 1
2023-03-10 21:20:16.304 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Transaction SendNextMessage 1 out at start. Holdoff false.
2023-03-10 21:20:16.306 [DEBUG] [nal.protocol.ZWaveTransactionManager] - NODE 255: Added 7 to queue - size 2
2023-03-10 21:20:16.309 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Transaction SendNextMessage 1 out at start. Holdoff false.
2023-03-10 21:20:16.311 [DEBUG] [nal.protocol.ZWaveTransactionManager] - NODE 255: Added 8 to queue - size 3
2023-03-10 21:20:16.313 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Transaction SendNextMessage 1 out at start. Holdoff false.
2023-03-10 21:20:16.315 [DEBUG] [rialmessage.GetSucNodeIdMessageClass] - Get SUC NodeID
2023-03-10 21:20:16.317 [DEBUG] [nal.protocol.ZWaveTransactionManager] - NODE 255: Added 9 to queue - size 4
2023-03-10 21:20:16.319 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Transaction SendNextMessage 1 out at start. Holdoff false.
2023-03-10 21:20:18.301 [DEBUG] [sactionManager$ZWaveTransactionTimer] - NODE 255: TID 5: Timeout at state WAIT_RESPONSE. 3 retries remaining.
2023-03-10 21:20:18.305 [DEBUG] [sactionManager$ZWaveTransactionTimer] - TID 5: Transaction is current transaction, so clearing!!!!!
2023-03-10 21:20:18.307 [DEBUG] [e.internal.protocol.ZWaveTransaction] - TID 5: Transaction CANCELLED
2023-03-10 21:20:18.309 [DEBUG] [nal.protocol.ZWaveTransactionManager] - NODE 255: notifyTransactionResponse TID:5 CANCELLED
2023-03-10 21:20:18.320 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Transaction SendNextMessage 0 out at start. Holdoff false.
2023-03-10 21:20:18.322 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 03 00 20 DC 
2023-03-10 21:20:18.325 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - NODE 255: Sending REQUEST Message = 01 03 00 20 DC 
2023-03-10 21:20:18.327 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - Message SENT
2023-03-10 21:20:18.329 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Transaction SendNextMessage started: TID 6: [WAIT_RESPONSE] priority=Controller, requiresResponse=true, callback: 0
2023-03-10 21:20:20.330 [DEBUG] [sactionManager$ZWaveTransactionTimer] - NODE 255: TID 6: Timeout at state WAIT_RESPONSE. 3 retries remaining.
2023-03-10 21:20:20.332 [DEBUG] [sactionManager$ZWaveTransactionTimer] - TID 6: Transaction is current transaction, so clearing!!!!!
2023-03-10 21:20:20.334 [DEBUG] [e.internal.protocol.ZWaveTransaction] - TID 6: Transaction CANCELLED
2023-03-10 21:20:20.336 [DEBUG] [nal.protocol.ZWaveTransactionManager] - NODE 255: notifyTransactionResponse TID:6 CANCELLED
2023-03-10 21:20:20.340 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Transaction SendNextMessage 0 out at start. Holdoff false.
2023-03-10 21:20:20.342 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 03 00 07 FB 
2023-03-10 21:20:20.345 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - NODE 255: Sending REQUEST Message = 01 03 00 07 FB 
2023-03-10 21:20:20.347 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - Message SENT
2023-03-10 21:20:20.349 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Transaction SendNextMessage started: TID 7: [WAIT_RESPONSE] priority=Controller, requiresResponse=true, callback: 0
2023-03-10 21:20:22.352 [DEBUG] [sactionManager$ZWaveTransactionTimer] - NODE 255: TID 7: Timeout at state WAIT_RESPONSE. 3 retries remaining.
2023-03-10 21:20:22.353 [DEBUG] [sactionManager$ZWaveTransactionTimer] - TID 7: Transaction is current transaction, so clearing!!!!!
2023-03-10 21:20:22.354 [DEBUG] [e.internal.protocol.ZWaveTransaction] - TID 7: Transaction CANCELLED
2023-03-10 21:20:22.355 [DEBUG] [nal.protocol.ZWaveTransactionManager] - NODE 255: notifyTransactionResponse TID:7 CANCELLED
2023-03-10 21:20:22.358 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Transaction SendNextMessage 0 out at start. Holdoff false.
2023-03-10 21:20:22.360 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 05 00 06 96 0F 65 
2023-03-10 21:20:22.362 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - NODE 255: Sending REQUEST Message = 01 05 00 06 96 0F 65 
2023-03-10 21:20:22.363 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - Message SENT
2023-03-10 21:20:22.365 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Transaction SendNextMessage started: TID 8: [WAIT_RESPONSE] priority=Controller, requiresResponse=true, callback: 0
==> /var/log/openhab/events.log <==
2023-03-10 21:20:22.242 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'RaspberryPiSystem_Cpu_Load' changed from 1.8 % to 1.1 %
==> /var/log/openhab/openhab.log <==
2023-03-10 21:20:24.367 [DEBUG] [sactionManager$ZWaveTransactionTimer] - NODE 255: TID 8: Timeout at state WAIT_RESPONSE. 3 retries remaining.
2023-03-10 21:20:24.369 [DEBUG] [sactionManager$ZWaveTransactionTimer] - TID 8: Transaction is current transaction, so clearing!!!!!
2023-03-10 21:20:24.371 [DEBUG] [e.internal.protocol.ZWaveTransaction] - TID 8: Transaction CANCELLED
2023-03-10 21:20:24.373 [DEBUG] [nal.protocol.ZWaveTransactionManager] - NODE 255: notifyTransactionResponse TID:8 CANCELLED
2023-03-10 21:20:24.376 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Transaction SendNextMessage 0 out at start. Holdoff false.
2023-03-10 21:20:24.379 [DEBUG] [wave.internal.protocol.SerialMessage] - Assembled message buffer = 01 03 00 56 AA 
2023-03-10 21:20:24.381 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - NODE 255: Sending REQUEST Message = 01 03 00 56 AA 
2023-03-10 21:20:24.383 [DEBUG] [ing.zwave.handler.ZWaveSerialHandler] - Message SENT
2023-03-10 21:20:24.385 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Transaction SendNextMessage started: TID 9: [WAIT_RESPONSE] priority=Controller, requiresResponse=true, callback: 0
2023-03-10 21:20:26.386 [DEBUG] [sactionManager$ZWaveTransactionTimer] - NODE 255: TID 9: Timeout at state WAIT_RESPONSE. 3 retries remaining.
2023-03-10 21:20:26.388 [DEBUG] [sactionManager$ZWaveTransactionTimer] - TID 9: Transaction is current transaction, so clearing!!!!!
2023-03-10 21:20:26.390 [DEBUG] [e.internal.protocol.ZWaveTransaction] - TID 9: Transaction CANCELLED
2023-03-10 21:20:26.392 [DEBUG] [nal.protocol.ZWaveTransactionManager] - NODE 255: notifyTransactionResponse TID:9 CANCELLED
2023-03-10 21:20:26.396 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Transaction SendNextMessage 0 out at start. Holdoff false.
2023-03-10 21:23:30.656 [DEBUG] [g.zwave.internal.ZWaveConfigProvider] - No bridgeUID found in getConfigDescription thing:zwave:serial_zstick:616a0823fc

try changing the UI controller port to /dev/ttyACM0. That looks like the port at 291.8662010 on the dmesg

I am confused. I though it is there. I placed this one in the configuration

Not an expert, but I have always seen the aeotec come up as ttyACM0 on both Rpi3 and Rpi4. Usually ttyAMA0 means there is a problem. Should be a quick try. Just change the port and wait 30 seconds. If not, then it is something else.