Upgrading from 2.319 to 2.414 - managing plugins with dependencies

Hi Folks, I’m about to embark on a second attempt at upgrading my jenkins server to the latest LTS version after my first try failed.

The current server is 2.319 running on red hat 8, and the server has java 8 and shares this with jenkins and a few other services.

I’m aware that I need to run java 11 as a minimum - I’ll be installing java 11 alongside java 8.
I’ll use yum to upgrade jenkins, and point the JAVA_HOME and JENKINS_JAVA_CMD environment variables to java 11 with systemctl edit jenkins.

My last failure was due to plugins as far as I could see, lots of “Failed loading plugin” type messages.

I have rolled back, and I can see that I have a lot of plugins in my server that require an update. However, if I look at the Update Center, the majority of them have messages along the lines of:

“Warning: This plugin is built for Jenkins 2.346.1 or newer. Jenkins will refuse to load this plugin if installed”

or:

Warning: This plugin has dependencies on other plugins that require Jenkins 2.346.1 or newer. Jenkins will refuse to load the dependencies requiring a newer version of Jenkins, and in turn loading this plugin will fail.

So I’m thinking that I can’t upgrade them while I’m using the server due to the dependencies, but I’m wondering if I should upgrade all of them immediately before doing the yum upgrade, and then upgrade and then check for further upgrades after jenkins comes back up? Would that be considered best practice for an upgrade?

Regards,

Brendan

1 Like

The process you’ve described is the preferred process for Jenkins controllers where the running version is less than 12-15 months old. With the 18 month old version that you are running, I don’t think you’ll be well served by upgrading plugins before performing the yum upgrade. The plugins that you install with that update will leave your Jenkins 2.319.3 installation unable to start.

The Jenkins plugin update center only provides data for Jenkins controller versions going back a little over a year. 2023-09-12T06:00:00Z the “Choosing a Jenkins version to build against” page lists the range of versions no longer supported by the update center as:

anything older than 2.361 for weekly releases, and 2.346.2 for LTS releases

Alternative - Two Step Upgrade

You could use yum upgrade to upgrade from your current version to Jenkins 2.361.4 and Java 11 without upgrading the plugins, then upgrade the plugins to match with Jenkins 2.361.4, then make the next step to upgrade to Jenkins 2.414.1.

Alternative - Upgrade by Backup / Restore

You could create a separate system that has Jenkins 2.414.1 installed with the latest releases of your current set of plugins and then restore the files from your current system into that separate system. Don’t restore the plugins from the old system to the new system and don’t restore the contents of the war directory from the old system to the new system. Use that new temporary system to confirm that the new configuration works.

Once that new system is working, then you can perform the yum upgrade on the production system and copy the plugins from the temporary system to the production system.

1 Like

Thanks Mark, that has clarified things for me.

I feel like the Two Step Upgrade option sounds like a good one - I’ll give that a go and report back, and then I’ll talk to management about scheduling more frequent jenkins upgrades! :slight_smile:

Update - the two step upgrade to 2.361.4 and then 2.414.1 was successful.

I first updated every plugin that didn’t have any dependencies or warnings on 2.319 and left the rest as-is.
Then upgraded to 2.361.4 using yum
Then updated every plugin that had updates available without dependencies or warnings
and then upgraded to 2.414.1 using yum
and finally updated any remaining plugins.

Thanks for your help!

-Brendan