Skip to main content
This lesson demonstrates how to back up and restore Jenkins configuration and jobs using the ThinBackup plugin. ThinBackup captures global Jenkins configuration and job-level configuration, with support for scheduled backups, differential backups, limiting retained backup sets, and excluding files using regular expressions. You can also choose whether to archive backups (ZIP) and include build results or artifacts. Key topics covered:
  • Installing and configuring ThinBackup
  • Triggering manual backups and viewing logs
  • Inspecting backup sets on disk
  • Restoring Jenkins and recovering deleted jobs
  • Considerations for backing up build artifacts and history
A screenshot of the Jenkins plugin page for "ThinBackup," showing the plugin documentation, badges, and details like Version 2.1.1 and installation stats. The dark-themed page also displays navigation tabs, descriptive text, and a small usage graph in the right sidebar.

Install and configure ThinBackup

  1. Install the ThinBackup plugin from Manage Jenkins → Manage Plugins.
  2. Open Manage Jenkins → Configure System and search for “Thin”.
  3. Configure the backup directory, schedule, type, and retention.
Example backup directory used in this demo:
If the directory does not exist, ThinBackup creates it before the first run. Other relevant options include cron schedules (for automating backups), choosing Full vs Differential backups, limiting the maximum number of backup sets, and specifying regex patterns to exclude files from backups.
A dark-themed Jenkins system configuration page showing backup settings—fields for backup directory, full/differential schedules, max backup sets, excluded files, checkboxes for options, and Save/Apply buttons. An orange warning notes the specified backup directory does not exist and will be created before the first run.
Recommended settings overview:

Additional configuration options

After saving the ThinBackup configuration, you can select:
  • Whether to include plugin archives in the backup
  • Whether to include additional files
  • Whether to compress backups (ZIP)
  • Whether to include build archives (artifacts) and/or build results (history)
These options affect backup size and duration—select them according to recovery needs.

Trigger a manual backup and view logs

To run a manual backup: Manage Jenkins → Tools and Actions → Thin Backup → Backup Now. ThinBackup logs only a few messages in its UI. For detailed messages, inspect Jenkins system logs: Dashboard → Manage Jenkins → System Log → All Jenkins Logs. Example condensed log output from a manual backup:

Inspecting the backup on disk

ThinBackup writes each backup set into the configured backup directory as separate folders (for example, FULL-YYYY-MM-DD_HH-MM). To verify backup contents on the Jenkins controller:
This folder contains global configuration files, plugin configuration, and job configuration XML files—everything ThinBackup considers essential for restoring Jenkins config and jobs.

Restoring Jenkins from a backup

To restore: Manage Jenkins → Thin Backup → Restore. The plugin shows available backup sets. Select the desired backup and choose restore options—examples include restoring plugin archives and restoring next build number files. Click Restore to start the process.
A screenshot of the Jenkins web UI showing the "Restore Configuration" page from the ThinBackup plugin, with a dropdown to select a backup date (2024-11-10 16:37) and checkboxes to restore the next build number file and plugins. The Jenkins sidebar and build/executor status widgets are visible on the left.
Restoring configuration may require a Jenkins restart for all changes to be applied cleanly. Plan restores during maintenance windows and ensure you have a current system snapshot in case you need to roll back.

Example: restoring a deleted job

  1. Delete the job you want to recover (for example, a pipeline named monitor-jenkins).
  2. Use Manage Jenkins → Thin Backup → Restore and pick the backup set that contains that job.
  3. After restoring, restart Jenkins if prompted or if the UI does not immediately reflect changes.
Example Pipeline configuration from the deleted job:
After restart, the restored job and its build history should reappear in the Jenkins UI.
Enabling backup of build results and artifacts will significantly increase backup size and duration. Consider whether you need full build archives or only job configuration and metadata for recovery. If you retain build artifacts, plan for additional storage and longer backups.
A dark-themed Jenkins pipeline page for a job called "monitor-jenkins," showing a build history list on the left and Start/End timeline markers for several build numbers on the right.

Best practices and wrap-up

  • Schedule regular full backups with periodic differential backups to balance recovery time and storage requirements.
  • Limit the number of retained backup sets to avoid uncontrolled disk growth.
  • Exclude large temporary files and workspace contents using regex exclusions unless you require them for recovery.
  • Test restores periodically in a staging environment to ensure your backup strategy covers all critical data (jobs, credentials, plugin states).
  • Keep plugin versions and Jenkins itself consistent between backup and restore environments to avoid compatibility problems.
You can run manual backups and restores at any time from Manage Jenkins → Thin Backup. ThinBackup provides a lightweight, configurable approach to saving Jenkins configuration and job definitions, with optional choices for plugins, build metadata, and artifacts.
A screenshot of the Jenkins web UI on the ThinBackup plugin page, with prominent "Backup now" and "Restore" buttons in the center. The dark-themed layout shows the Jenkins logo and a left navigation panel with items like Build History, Manage Jenkins, and Build Executor Status.
Further reading and references:

Watch Video