I decided to install OH4 as fresh install so I wasn’t upgrading a system that was originally 2.5 and then 3.4.
Also, I didn’t want to start again or slowly move the rules and items etc to another system in parallel.
Another thing was I wanted to keep my graph data for the past year.
I am using Debian bookworm and I used the tar command to get the files I wanted (json, persistence, icons, etc)
After running the tar command and also doing a full openhab backup for just in case, I purged opehab 3.4 from my server.
I installed zulu java 17 and then I installed the latest OH4 stable version and started it and waited until the webpage came up. Then I stopped OH4.
I restored the tar and also in the script I had logic to create the addons that I needed including the Nashorn addon and also in the script I had logic to add application/javascript;version=ECMAScript-5.1 so Nashorn would work.
I ran sudo dpkg-reconfigure openhab and this ran the upgrader tool.
Then I started OH4 and watched the log file and everything worked!
I had my persistence data and graphs as well.
After running for a day I went and converted all the Nashorn rules to ECMAScript 262 Edition 11. and then removed the Nashorn addon.
Everything is working and I am happy with the results and have no memory issues and all is good.
A big thank you to all involved in the new version.