OH 4 uses items from OH 3 after backup/restore migration

Hello,

I’m using openHAB on an ArchLinux based server and the package available in the AUR are version dependent in that they are named openhab3 and openhab4 which means they can installed side by side.
This allowed me to to a “backup”/“restore” migration on the same machine, which went smoothly with the expected warning about change of ownership for configuration files.

Upon starting openhab4 I went to see the “about” page and surprisingly, it still said openHAB 3.4.5
So I tried connecting to the console, but it immediately replied with “connection reset by peer”
Looking at the log file, I saw that openhab4 was trying to read the key file from the /var/lib/openhab3/etc/ folder.

Now, the package owner for openhab4 at AUR gave a very detailed upgrade process here:
Arch Linux AUR openhab3 to openhab4 Upgrade Instructions · GitHub

Thing is, most are related to testing on a secondary machine, but I had missed the following two lines:

find /var/lib/openhab4 -type f -exec sed -i 's/\/var\/lib\/openhab3/\/var\/lib\/openhab4/g' {} \;
find /var/lib/openhab4 -type f -exec sed -i 's/\/usr\/share\/openhab3/\/usr\/share\/openhab4/g' {} \;

They are here to replace the various references to the openhab3 folders with references to openhab4 folders.

After having stopped openhab4, run those commands, and restarted openhab4 I was able to log into the console via SSH as was possible in the past and it shows me this nice welcome message:


                           _   _     _     ____
   ___   ___   ___   ___  | | | |   / \   | __ )
  / _ \ / _ \ / _ \ / _ \ | |_| |  / _ \  |  _ \
 | (_) | (_) |  __/| | | ||  _  | / ___ \ | |_) )
  \___/|  __/ \___/|_| |_||_| |_|/_/   \_\|____/
       |_|       4.1.1 - Release Build

Use '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
To exit, use '<ctrl-d>' or 'logout'.

So clearly, I’m on the 4.1.1 version and all should be fine.
But if I go to http://myserver:8080/about/ I still see the version being 3.4.5 as before:

Clearly, I have missed something here, but clearing the browser cache nor using another browser did change a thing.

So I went on to remove the cache and tmp folder content from the /var/lib/openhab4/openhab4 folder and after having restarted the service, this time the About web page shows 4.1.1 as does the console.

This message may seem pointless, but I felt it could help others running on similar distributions or running on similar “strange” issues.

And if I missed something else that could cause problems in the future, please let me know.

I haven’t read all your post yet, but when running multiple instances of openhab regardless of their version, each instance must be set to listen on different ports.

Here are some relevant ports
Http
Https
Lsp
Karaf shell port

So if one instance runs on the default ports, the other one must use different ports to avoid clashes.

Thanks for the warning. In my case I only ran one at a time but it’s good to know about this potential issue