2.X SD card died ... migrate to 3.X?

Hi all,

Here’s my situation: just before christmas my Openhab setup failed (it’s in a remote house, so I only recently got access to it). Since this controls the heating (and it’s winter here) this is very important to fix.

I can read from the SD card so I bought a new 16GB card (and a new RPi4 - it was on a 3 before) and tried to install the latest image. After a bit of fiddling (I have really limited time): I couldn’t work out how to copy the /etc/openhab2 to something the new installation could read (I was trying to do this completely headless - no keyboard or screen, because I only came with my laptop).

So I then I decided to be pragmatic and give up: I tried to use openhabian-config to revert to 2.5 … however after reboot openhab wouldn’t start.

So now I’m not sure what to so. I don’t have a ton of rules and could probably migrate them but I do have >40 z-wave items and I really don’t want to have to add these from scratch (I’m leaving tomorrow morning and so I think it’s more or less impossible to do). My items were done manually, not through paper, and so were defined in /items.

So my question is: if I start from a clean openhab 3 install can I copy my old configuration somehow, and if so, how? (priority is on copying items - rules I can work out after).

I also have a lot of InfluxDB data I’d really like not to lose - can this just be copied to /var/lib/influxdb/ on the new RPi4?

Thanks in advance - having the heating on continuously is getting very expensive, but with young kids I can’t easily come and fiddle, so advice is much appreciated!

If you your old installation worked soly by textual config. files and you have a copy of your old 2.5 configuration folder (e.g. the folder that has /items / rules / things) you could restore and migrate farely quickly (and dirty) by:

  • Installing OH3 on new system;
  • install required bindings;
  • drop all textual config files in the right folder on new system ( eg. *.items in /etc/openhab/items , *.rules in /rules etc.)

Watch the logs closely for errros.

some rules might have errors because of changes between 2.5 and 3.x. But can all be fixed using hints from the logs.

This should/could have your system up and running again quite fast… atleast for 80%.
In regards to the DB make sure you have a copy atleast. I cant advise you on that.

Good luck

Also note that the Zwave Nodes live in the controller. So OH will automatically discover the Things over again. The only extra work would be for battery powered devices that need to be woken up to finish discovery.

Your .items could probably be used as is, so long as you give your Zwave Controller Thing the same ID as the previous one had. You’ll probably want to capture and use the same security id if you’ve securely included any of your devices which you can find in the Things jsondb entry of your old config.

I can’t guarantee it but copying the InfluxDB lib folder should work. That’s essentially how it works when running InfluxDB in Docker. no

But beware, what ever caused your as card to fail could have corrupted any files you read off of the card.

Thank you both very much! In the end I decided to re-install openhabianpi from scratch, but this time to force it to download 2.5.12 (by setting the version requested to stable). This worked and I could copy the items etc over, and they seem to be recognised. I think the InfluxDB database might be corrupted unfortunately … but I’ll see if I can recover anything.

I couldn’t get ZWave working before I had to leave, but I was pretty confident I could log in remotely to fix whatever the issue was.

Unfortunately I have just found out that the Gen5 Aeonlabs Zwave stick is not compatible with the RPi4 (something about it wrongly being detected as USB3):

What is very frustrating is there is a USB2 hub right next to the Pi on my desk. I wish I’d had time to do some more investigation before leaving! :frowning:

Oh well, hopefully I can get back there in a week or so. :persevere: Thanks once again for your help (I will try to upgrade to OH3 once I’m back in business again)