Wish to migrate from Windows 10 openhab 2.5 to Raspberry Pi 4 openhab 3

I have a fresh openhab 2.5 install on a Windows 10 machine and it is working great. All code was developed in the last couple of weeks, no 1.x holdovers.

I’d like to get everything running on a new Raspberry Pi 4, using openhab 3. So, to the experts, what is the best process? Should I get my Raspberry running with 2.5, and then migrate to 3? Or do the migration to 3 on my PC and then port it over?

I’m getting familiar with openhabian, and have been able to use the latest release and install either 2.5.11 or 3 on the Raspberry.

I’m leaning toward getting 2.5.11 running on the Raspberry, work out all the kinks related to the hardware change, then once I have it stable, migrating it to 3.

If I go this route, what is the best process for porting 2.5 over from Windows to Raspberry? I found some references back in 2016, but it’s not clear to me what the best approach is.

FYI, I created all my Things in PaperUI, and everything else has been done via the item/rules/sitemap/etc files.

There’s no need to start with 2.5 on the RPi. Just install OH3 and then run the two in parallel while you move your config over from the Windows machine. If you want, you can even use the new remote openHAB binding, but I don’t think that’s necessary since you’re just getting started.

Text can be directly copied from your .items files and then used to bulk-add items in OH3, though you may have to tweak things here or there. My DSL rules copied over largely intact, with a few exceptions for some of the breaking changes. I might rewrite them in the future using one of the newer methods, but for now I’m going with the “ain’t broke, don’t fix it” approach.

The great thing is that you’ll be able to compare things between your systems in real time. I’ve been converting to OH3 this weekend, but I’m keeping it all on the same RPi. So, I didn’t benefit from being able to copy settings in real time…which was annoying when I realized that I forgot a few things.

Do you have any Z-Wave devices?

1 Like

Thanks for the info. I have about 100 Z-Wave devices, using the Aeotec controller.

I also have 3 RS232 serial devices, figuring I can use 3 of the Raspberry USB ports with USB<->RS232 Serial converters.

So, if I go the route you are suggesting, should I install the needed bindings, then create my Things from the new interface, and then start bringing over my item, rule, sitemap, etc. files?

Just put openhabian on pi and copy files over

When you say ‘copy files over’ - copy the entire contents of the ‘config’ and ‘userdata’ folders? Will that also bring my Things over? I guess I’m not sure where my Things are located, since I created them in the PaperUI. And, not sure when I copy these folders if the old bindings also come over. Thanks,

You can create a backup using the cli tool and restore on new system

1 Like

I think this depends on how much you want to adapt to the new MainUI. I wanted to move most of my items into the database, so I’ve been importing them. If you want to do that, you just have to discover the things, then take your time importing your various items files until they’re all set. After that, you can just copy your rules over and you’re good to go.

But if you just want to get it working as quickly as possible, use the backup method suggested by James. I just wanted to treat it more as if I was starting from scratch.

You should just be able to unplug the controller and plug it into your RPi. However, if you have any devices that have been securely included (such as door locks), you need to copy the security key from OH2 BEFORE you add those secure devices in OH3. I made that mistake, and it proved a bit tricky to recover (though it should have been easy). I suggest reading this thread.

I suspect that the openhab-cli backup will copy over your security key, but I’m not 100% certain of that.

1 Like

I tried exactly what you are contemplating and ultimately reverted back to 2.5M10. I had performance issues on the PI 4 compared to my Windows box, z stick issues that require a hub as a workaround, and tons of unresolvable sitemap errors. I’ll eventually try again once a few more releases come out and some of the kinks are worked out.

1 Like

You should in fact to get all the important stuff copied (and only that).

2 Likes

Well, I did the conversion. I started with a fresh install of openHAB 3 on a Raspberry Pi 4. Added all my Bindings. As I created Things through the interface, I cut and pasted my .item files over. Only minor edits were required to the channels due to naming. Once I had all my Things and .item files over, I copied over my maps, scripts, and rules. I had very minor issues:

  1. the now.plusMillis function is apparently not used anymore. Changed to plusSecond where I could, and plusNanos where needed.
  2. one of my Z-Wave things didn’t get created properly and I had to re-learn it.
  3. The ‘system shuts down’ action isn’t used anymore, so I removed the rule that used it.
  4. my script had to be renamed with an additional ‘.script’ at the end in order to be called.
  5. I have an issue where a timer that is being rescheduled is triggering a Warning in the log, “Rescheduling failed as execution has already started!”
  6. I think I may have a couple minor issues with my sitemap, still going thru everything.
  7. The new serial binding doesn’t allow you to pick 1200 baud, however you can go to the code and change it and it works (I have a security system that is set at that baud rate.)
  8. I have some time related items I still need to clean up, but this appears to be a well-documented change so shouldn't be an issue.
    

I think that was it. I’m very impressed! I preferred going this approach because it helped me learn the new interface. I’m curious how the performance will differ from my PC, but so far so good.

1 Like