[armbian] upgrade from 2.5.x to 3.x

Good evening.

I am currently running OpenHab 2 on an Odroid C2 powered by armbian 21.02.3

root@hestia:~# openhab-cli info

Version:     2.5.12 (Build)

User:        openhab (Active Process 2649)
User Groups: openhab tty dialout audio

Directories: Folder Name      | Path                        | User:Group
             -----------      | ----                        | ----------
             OPENHAB_HOME     | /usr/share/openhab2         | openhab:openhab
             OPENHAB_RUNTIME  | /usr/share/openhab2/runtime | openhab:openhab
             OPENHAB_USERDATA | /var/lib/openhab2           | openhab:openhab
             OPENHAB_CONF     | /etc/openhab2               | openhab:openhab
             OPENHAB_LOGDIR   | /var/log/openhab2           | openhab:openhab
             OPENHAB_BACKUPS  | /var/lib/openhab2/backups   | openhab:openhab

What is the best way to upgrade to OpenHab 3?
I would like to upgrade without reinstalling as I have many custom items and scripts.

I installed OpenHab 2 from armbian-config softy.
Now, from there, I can see both OpenHab2 (checked) and OpenHab3 (unchecked).
Should I uncheck v2 and check v3? Or keep both checked?

Or should I upgrade another way?

Thank you.

The first step would be to create a backup :wink: (sudo openhab-cli backup)
Copy it to a location where it is save.

Back then I tested the migration on Windows, openSUSE and RasPiOS. On Windows and RaspiOS the migration of OH3 looked up the OH2 installation and took over what it could. On openSUSE it was a bit different due to the installation mechanisms the OS has; older pachages and newer packages cannot share ressources, so OH2 was uninstalled before OH3 was installed (due to the same user “openhab” that both packages claimed for themselves). In that case I ended up with an empty OH3.
I have no experience with armbian, hence the hint with the backup. When something goes wrong, you will be able to rollback the operation.

1 Like

Just be aware that bintray is currently down for scheduled maintenance so the stable repos are unavailable.

1 Like

Thank you.
Yes, I have an automated backup script every week, so I can rollback to any week in the last year.

Now, I will wait to see if someone already migrated in armbian.
I am afraid that in softy, unchecking OH2 and checking OH3 will completely delete OH2 and reinstall a fresh OH3.
I am also not sure if softy is using apt-get behind…

Worst case scenario, how easy is it to restore an OH2 backup to a fresh OH3 setup?

I have custom items, persistence, rules, services, sitemaps and transforms in OH CONF directory.

Some directory names have changed. (openhab2 becomes openhab, for instance).

Due to what Bruce rightly mentioned I do not think you can apply a OH2 backup into an OH3 installation. If you have textual configuration files you could put the single files into the corresponding folders, but be aware you need to adjust some things. There are threads in the forum that will help with this.

And concerning your regular backup: :+1: :+1: :+1:
I’ve read a few postings in the forum where the OP did not care about backups and ended in a situation he did not expect, without a way back to normalcy. As I did not know your situation I mentioned it. No offense meant.

1 Like

No offense taken :grinning:
Nothing wrong in reminding about backups. Better be annoyed by hearing too much about it than loosing precious data forever…

I did try to update from softy, but nothing happens here…

So here is what I did, and hopefully would work for anyone using OpenHab 2 on armbian installed through armbian-config softy:

wget https://cdn.azul.com/zulu-embedded/bin/zulu11.45.27-ca-jdk11.0.10-linux_aarch64.tar.gz
sudo tar -xvzf zulu11.45.27-ca-jdk11.0.10-linux_aarch64.tar.gz -C /opt/jdk/
sudo update-alternatives --install /usr/bin/java java /opt/jdk/zulu11.45.27-ca-jdk11.0.10-linux_aarch64/bin/java 1
systemctl stop openhab2
sudo update-alternatives --config java
sudo apt update
sudo apt install openhab
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable openhab.service
sudo /bin/systemctl start openhab.service

And all works no problems. All my automated tasks and sitemaps are here in the OpenHab app on tablets and phones as before.

1 Like