I followed exactly this approach to migrate my current 3.4 to 4.0 to openhabian:
- start from a completely new installation and download the latest 4.0 snapshot. Note that it does not install the openhab 4.0 snapshot but installs 3.0 Release (my understanding is that openhabian always installs the latest release by default).
- let it smoothly install until it is up and running. You will see it is 3.4 (at the time of writing)
- optional: i then installed option stuff like samba and influx
- make a backup of your current system and copy it to the openhabian 4.0 system
- use openhabian-config to restore it into 3.4 (like it is currently running on your current system)
- let it restore the backup and startup until everything is running without a problem
- start openhabian-config and install java-17 via (45)
- only then go into openhabian-config again choose the snapshot version of openHAB via (41) → openHAB snapshot
- cross your fingers.
The above worked for me.
Which also means that the fix for gson has worked out fine.