Jenkins setup: We currently have Jenkins version 2.379 with JDK 11. We are planning to upgrade to the latest jenkins version 2.541 with JDK 21. Please advise the steps for this upgrade. We are planning to replace the latest war file to achieve this. will this work if we jump these many versions?
Doing a large version jump is best handled with testing your plan. You may have to do smaller version jumps to handle this.
Now, there are a few environmental things you haven’t mentioned, like what OS are you doing this on? How was it installed? Are you upgrading in place or can you entertain building a new system and renaming it on completion? Do you have separate controller and agents? Probably a lot more that I’m forgetting this morning.
The answers will vary depend on your answers.
One scenario I did a large jump on that required smaller updates was a container-based controller with dedicated and ephemeral agents. I was fortunate enough to have a test system available and tried the full upgrade at once; it failed due to plugin changes. Smaller upgrades pulled in plugins successfully. The JDK changes were trivial as the controller’s containers kept the JDK contained. The agents needed a bit more care to match JDK during the upgrade steps.
There is no one answer that we can give you without knowing a bit more about your environment.
Most important: Do a backup before doing anything on the productive system
A one step migration is possible when you use the GitHub - jenkinsci/plugin-installation-manager-tool: Plugin Manager CLI tool for Jenkins · GitHub to download all plugins for you Jenkins upfront, then while Jenkins is down copy the downloaded plugins to the plugins folder in your JENKINS_HOME. That should ensure that you have a consistent set of plugins. While doing that revisit all installed plugins and check if some are obsolete
As @doofus_canadensis mentioned having a place where you can test this out is a big advantage. What you could do is copy the JENKINS_HOME to a new machine (or folder) except the jobs folder. Then start Jenkins with the new version (with plugins updated already (see above)) from that copy, you should then see if any plugins do not load.
Oh geez yeah. I meant to mention backups. Total fail on my part.
Hi All, Please find the below details.
Server OS: Windows server 2022
Jenkins is currently running as windows service.
We are planning to do in-place upgrade (replacing the war file method).
Unfortunately, there is no test environment. We are taking full server snapshot and taking required backup files/jobs before we proceed with this.
Please guide me how we can implement this.
If single big move does not work, Will this below approach work? Also please let me know how to handle the plugins update?
Step1:
JDK11 to JDK17
2.379 → 2.440
Step2:
JDK 17 to JDK21
2.440 → 2.541
Then you only need to upgrade the controller. It makes sense to change that in the future as running builds on the controller is discouraged.
Is there a reason that you want to upgrade Java to 21 only? I would recommend to directly use Java LTS 25, then you have 2 more years that your Java version can be used with Jenkins…
Thanks for the update. We will use JAVA 25 version. Do you have any upgrade steps using war file replacement method?
