Before upgrading
Take a SNAPSHOT of your CloudBees CI platform. For the Operations Center and every master:
Note: In the case something unexpected happens, the rollback process in based on the Backup of your instance. |
-
Operations Center must be upgraded first, then Client Masters.
-
The Client Master connected to the Operations Center does not have to be at the same version.
The version of Operations Center must always be more recent or as old as the version of the Client Masters that are connected to the Operations Center (Operations Center >= Client Master version). |
Recommendations
Setup a test environment
This is ideally a full test environment with the Operations Center and Client Masters and requires a test license
. If this is not feasible, just having a test master with representative jobs will work.
Enable CloudBees Assurance Program
Ensure that CloudBees Assurance Program is enabled to avoid plugin dependency issues or incorrect versions installed. |
Upgrade to latest version
CloudBees recommends that you always upgrade to the latest version of your CloudBees product, ensuring a wider lifecycle support coverage plus more security patches added (CloudBees Security Advisory), more fixed issues, and more new features included.
Upgrade plugins
CloudBees recommends that you upgrade your plugins before upgrading a Jenkins instance. For instructions on upgrading plugins, see Upgrading plugins from the Plugin Manager. Run tests after upgrading the plugins to ensure that the upgrades are functioning as expected.
Upgrade instance where it is running
CloudBees highly recommends that you upgrade Jenkins to the same location where it is running even if it is in the production environment.
Doing a backup of $JENKINS_HOME
and the $BUILD_DIR
- in case it is outside the default location - should be enough to revert to the previous status.
CloudBees does not recommend that you keep two different instances working at the same time. This is to avoid downtime while performing the upgrade unless you really know what you are doing - it will be very difficult to replicate the exactly same environment.
-
JNLP agent will not work correctly as the
$JENKINS_URL
location will be different. -
Credentials might fail in case the secret is not the same on both instances.
-
The OS might not be configured in the same way. i.e
ulimit
. -
The CloudBees CI configuration might not be correctly replicated.
Stop using Apache Maven builds (if possible)
The Maven plugin plugin is not recommended as it is considered unreliable by the Community. Therefore, it is recommended that you migrate jobs using this plugin to Pipeline Jobs with the Maven integration.
If (and only if) you are able to migrate your Maven plugin builds, please carefully read the Maven jobs and Java versions compatibility guide.
Upgrade process
Visit CloudBees downloads
Go to the downloads page. Select your desired distribution type, and review the instructions.
-
WAR
-
RPM
-
OpenSuse
-
Debian
-
Microsoft Windows
-
Docker
Installation procedures
WAR
If your CloudBees CI instance is run with the command java -jar cloudbees-core-cm.war
or java -jar cloudbees-core-oc.war
, you can simply replace the jenkins.war
file with the latest version.
Linux
Red Hat / CentOS
-
Master -
yum upgrade cloudbees-core-cm
-
Operations Center -
yum upgrade cloudbees-core-oc
RPM/YUM with High Availability |
The RPM package contains a post-install script to ensure ownership on several files including JENKINS_HOME
. Therefore if High Availability is setup, this could lead to I/O Errors - for example when upgrading one node while another one is still running. More information is available in JENKINS-23273.
To workaround this problem, you can skip this script by adding the property JENKINS_INSTALL_SKIP_CHOWN="true"
under /etc/sysconfig/jenkins
.
Servlet container
Once a .war
archive has been downloaded, follow the servlet container’s existing application deployment process.
When using servlet containers, CloudBees CI will set the JENKINS_HOME
to the $APP_SERVER_USER/.jenkins/
folder.
If the servlet container installation does not include write permissions to this folder for this user (sometimes done for security), you either need to grant appropriate permissions or override this setting by adding the "-DJENKINS_HOME=$MY_JENKINSPATH"
argument in your servlet container startup. Refer to the servlet container’s documentation for how to add startup arguments.
Tomcat
Use environment variable CATALINA_OPTS
to add:
-
-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true
. -
-Dorg.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true
which is needed for Blue Ocean.
CloudBees recommends that you configure it in the script $CATALINA_BASE/bin/setenv.sh
(Linux) or %CATALINA_BASE%\bin\setenv.bat
(Microsoft Windows) that you’ll create to customize your application server.
Custom container installations
If you use a custom container, you will find the cloudbees-core-cm.war
or cloudbees-core-oc.war
file in the deploy directory of your container. For example, /usr/local/jboss/server/default/deploy/cloudbees-core-cm.war
would be the location for a default JBoss installation.
Microsoft Windows
To upgrade on Microsoft Windows servers, a new .zip
must be downloaded from the downloads page and installed.
Post-upgrade notes
In case, JNLP agents (specifically for Microsoft Windows) are not able to connect, review the article Windows agent offline or unable to connect.
Review articles in our Best Practices and apply changes accordingly.