Certified Jenkins Engineer

Backup and Configuration Management

Demo Upgrading Jenkins

Upgrading Jenkins with minimal downtime requires planning and the built-in Prepare for Shutdown feature. In this guide, we’ll cover:

  • Checking for new Jenkins releases
  • Reviewing changelogs
  • Preventing new builds during the update
  • Performing the WAR file upgrade
  • Verifying the new version

1. Choose Your Jenkins Release

Navigate to the Jenkins download and deployment page. Compare the Stable (LTS) and Weekly packages:

The image shows a webpage from Jenkins.io detailing the download and deployment options for Jenkins, including Stable (LTS) and Weekly releases, along with instructions for downloading Jenkins.

Release TypeUpdate FrequencyIdeal For
LTSEvery 12 weeksProduction environments requiring stability
WeeklyWeeklyTesting the latest features and bug fixes

2. Check for Updates on Your Dashboard

Log in to Jenkins and go to Manage Jenkins. The dashboard shows pending updates and plugin advisories:

The image shows a Jenkins dashboard interface with various management options and warnings about deprecated plugins and security issues. It also indicates that a new version of Jenkins is available for download.

Click Changelog to review the release notes:

The image shows a webpage displaying the Jenkins LTS Changelog for version 2.492.1, detailing enhancements and notable changes.

For example, upgrading from 2.462.1 to 2.492.1 brings critical security fixes and performance improvements. Copy the WAR URL (e.g., https://updates.jenkins.io/download/war/2.492.1/jenkins.war) for the next step.


3. Prepare Jenkins for Upgrade

Before replacing the WAR, enter shutdown mode so existing builds finish and no new builds start:

  1. Go to Manage Jenkins → Prepare for Shutdown
  2. Add a reason (e.g., “Planning for upgrade”) and confirm

A banner appears and all new build requests queue:

The image shows a Jenkins interface indicating a shutdown in progress for an upgrade, with options to update the reason or cancel the shutdown.

Monitor the build queue to ensure no jobs are running:

The image shows a Jenkins dashboard displaying a list of build jobs with details such as last success, last failure, and duration. The interface includes navigation options and a build queue status.

Any attempt to start a new job—like ascii-build-job—will now wait until after the upgrade:

The image shows a Jenkins dashboard for a project named "ascii-build-job," displaying build flow details, downstream projects, and permalinks. A red banner indicates "planning for an upgrade."

Note

Ensure all running builds complete and no new tasks remain in the queue before stopping the Jenkins service.


4. Upgrade the Jenkins WAR

On your Jenkins host, run the following commands:

# Stop Jenkins
sudo systemctl stop jenkins

Warning

Always back up or rename your current WAR before replacing it.

# Backup the existing WAR
sudo mv /usr/share/java/jenkins.war /usr/share/java/jenkins.war.bak

# Download the new WAR
sudo wget -O /usr/share/java/jenkins.war \
  https://updates.jenkins.io/download/war/2.492.1/jenkins.war

# Restart Jenkins
sudo systemctl start jenkins

5. Verify the Upgrade

After Jenkins restarts, log back in and confirm the new version under Manage Jenkins or in the dashboard footer. It should display 2.492.1.


Watch Video

Watch video content

Previous
Demo Validating Backup