There must be a simple way to do this, but I cannot find it here. Not just the upgrade of JAVA and OH, but migrating my config as well.
Copy my user directory over to the OH4 directory and simply deal with the fallout?
Is there an actual procedure?
Is there some command line or other “program” to run that does some amount of migration/udates?
Or should my 4.0 M2 install have recognized that I already had 3.4.2 and did the migration for me?
First it’s worth mentioning that a command line upgrade tool is in development. This tool will do stuff to your config to correct breaking changes and the like. But it’s not yet ready, certainly not for OH 4.0 M2.
The best process, if moving to another machine with a new version of OH is the following:
Install the exact same version of OH on the new machine as is running on the old machine (e.g. OH 3.4.2).
Use the backup script to get a copy of all the old configs, transfer that to the new machine and use the restore script to copy the configs to the new machine.
Verify everything works.
Now upgrade the new machine instance to OH 4.0 Mx using the normal upgrade processes.
The restore scripts do not perform any upgrade steps so it’s important to restore to the same version of OH as the backup came from, and then upgrade.
Note: this is mostly just a more generic version of the steps @Mark_VG outlines
Look in the restore script or run it with --help for details. But no, it doesn’t know where to go get your backup files. You need to transfer the zip to the local machine and then you can pass the path to the file as an argument to the restore script, or put it in the well known location (I think it’s $OPENHAB_USERDATA/backups but am not sure, I run in Docker so use my own backup and restore processes).
This is where the question came up. I can’t find “the normal upgrade process” description. I simply downloaded the .msi and installed 4.0 which, of course, didn’t “upgrade” anything. It was it’s own stand-alone “pristine” install. None of my 3.4.2 stuff.
There is clearly a difference between the INSTALL process (well defined) and UPGRADE process (which I searched and found very fragmented info).
However - I interpreted this to mean I was going from 3.0 > 3.1 > 3.2, not an “upgrade” from 3.x > 4.x. This is because I installed OH in a VERSION unique directory. OH 3.4.2 and OH 4.0. So my brain was thinking the 3.4.2 > 3.4.3 would not be an upgrade - since it was simply replacing binaries in an existing folder. Not upgrading to a new version.
Each OS will have their own specific process, sometimes automated, sometimes not.
We welcome any contributions to the docs, especially docs like the Windows installation docs. Only a minority of OH users run on Windows (none of the developers/maintainers that I know of) so there are not as many people to volunteer to update those docs.
The process is the same whether going from 3.1 to 3.2 or from 3.2 to 4.3. Even going between second point versions is upgrading to a new version.
I don’t judge. I’m sitting here at my desk with Ansible running an update on Raspberry Pi OS (Linux) and Ubuntu (Linux), on a Mac laptop, with an RDP session open to a Windows 11 machine. When I’m not at my desk I use a Chromebook (kinda sorta Linux). And all my services save one run in Docker containers.
It’s all good. But there is a lot to be said for popularity. The more people who use it, the more people to help with the docs and help on the forum.
Though I will say that I experience a special kind of rage every time I have to use Finder on the Mac.
Oh, I almost forgot, my firewall/gateway is OPNsense which runs on FreeBSD. About all I don’t have any more is a Solaris box (I won’t have anything to do with Oracle if I can help it).
I’m using a Ubiquiti EdgeRouter for my gateway. Cuz it’s cheap(er) hardware than their Unifi Gateway or a Watchguard (which is way more configurable than the Ubiquiti - only because of the UI). But Ubiquiti via UI allows me to create 2 VLANs. One is locked to ETH1 and the other to ETH3, 4, 5. I thought that a bit odd. Well - it turns out - it is quite arbitrary. The UI is restricted. From the Comamnd Line I can create FOUR VLAN’s if I want (I don’t). Why do I get out of bed some days.
I SHOULD have done a cheap box with a couple NICS and done exactly what you did.
No sure which MSI file you’re installing because OpenHab on Windows is just a ZIP file that you extract into a certain directory and run it from there. I assume the MSI you mean is the Java 17 install??
As previously mentioned by @Mark_VG the Best (and only?) way to safely upgrade OH on windows is to use the PS Script as outlined in the Windows Install Docs.
Backing up is simply a matter of copying your whole OH3 Directory(Which in itself can be run on its own Java withstanding) before upgrading.
Apart from that the only thing to keep in mind is that OH3 is Java 11 while OH4 is Java 17… to switch between the two Java’s requires the environment variable JAVA_HOME to be set to the correct directory.
I have OH3.4.2 and OH4.0 directories. I’m assuming for the upgrade script to work, it needs to upgrade in the same directory (ie: I copied my OH User stuff from 3.4.2 > 4.0 and run upgrade in the 4.0 directory).