{"id":432,"date":"2026-10-14T09:12:04","date_gmt":"2026-10-14T09:12:04","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2015\/09\/20\/jenkins-backup-and-restore-process\/"},"modified":"2026-10-14T09:12:04","modified_gmt":"2026-10-14T09:12:04","slug":"jenkins-backup-and-restore-process","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/jenkins-backup-and-restore-process\/","title":{"rendered":"Jenkins Backup and Restore Runbook: ThinBackup, Filesystem Archives, and Recovery Steps"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Jenkins backup and restore is a core reliability control for CI\/CD teams: if a controller host, disk, or VM fails, you need a repeatable way to recover jobs, credentials, plugins, and system configuration. This guide provides an implementation-focused runbook you can adapt for plugin-based backups (including ThinBackup-style workflows) or filesystem-level backups.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Originally published on 2015-09-20; fully revised and updated.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Legacy source and preserved references<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The original post was a short link collection. The references below are preserved for attribution and historical context; validate each one before using it in production workflows.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.devopsschool.com\/blog\/jenkins-backup-and-restore-process\/\">Original article permalink<\/a><\/li><li><a href=\"https:\/\/www.devopsschool.com\/blog\/jenkins-backup\/\">Jenkins Backup and Restore using ThinBakcup<\/a><\/li><li><a href=\"https:\/\/www.sghill.net\/how-do-i-backup-jenkins-jobs.html\">How Do I Backup Jenkins Jobs using Grunt?<\/a><\/li><li><a href=\"http:\/\/www.clausconrad.com\/blog\/backup-jenkins-configuration-to-s3\">Backup Jenkins configuration to S3<\/a><\/li><li><a href=\"http:\/\/christoph-burmeister.eu\/?p=1981\">bash-backup-script for jenkins job-configs via user-crontab<\/a><\/li><li><a href=\"http:\/\/softwaretester.info\/backup-and-restore-jenkins\/\">Backup and restore Jenkins using jenkins plugins<\/a><\/li><li><a href=\"https:\/\/www.youtube.com\/watch?v=ZCfrNvu6nMc\">YouTube video referenced in the source post<\/a><\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The original embedded YouTube gallery reported an API key restriction error, so this update does not rely on the embedded video content.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What to include in your Jenkins backup set<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For most traditional Jenkins controller installations, the critical state is under <code>JENKINS_HOME<\/code>. At minimum, include configuration, jobs, plugins, and credential material needed for decryption and runtime access.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>${JENKINS_HOME}\/config.xml<\/code> and related global configuration files<\/li><li><code>${JENKINS_HOME}\/jobs\/<\/code> (job definitions and job-level config)<\/li><li><code>${JENKINS_HOME}\/plugins\/<\/code> (installed plugin binaries and metadata)<\/li><li><code>${JENKINS_HOME}\/users\/<\/code> and node\/controller metadata as applicable<\/li><li><code>${JENKINS_HOME}\/credentials.xml<\/code> together with <code>${JENKINS_HOME}\/secrets\/<\/code><\/li><li>Any external dependencies your pipelines require to run after restore (for example, shared libraries or external secrets backends)<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Backup strategy options compared<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Approach<\/th><th>How it works<\/th><th>Strengths<\/th><th>Trade-offs<\/th><th>Good fit<\/th><\/tr><\/thead><tbody><tr><td>Plugin-based backups (for example ThinBackup-style)<\/td><td>Configured from Jenkins UI to capture selected Jenkins data<\/td><td>Simple to adopt for teams already managing Jenkins in UI<\/td><td>Coverage and compatibility depend on plugin behavior and Jenkins version; still requires off-host copy and restore testing<\/td><td>Small to medium setups wanting UI-driven backup operations<\/td><\/tr><tr><td>Filesystem archive (tar\/rsync)<\/td><td>Archive <code>JENKINS_HOME<\/code> with OS tools and move copies off-host<\/td><td>Transparent, scriptable, easy to integrate with existing backup tooling<\/td><td>You must design consistency, retention, encryption, and scheduling<\/td><td>Ops teams that prefer scriptable and auditable backup pipelines<\/td><\/tr><tr><td>Storage snapshots (VM disk or persistent volume)<\/td><td>Snapshot storage layer and retain snapshots per policy<\/td><td>Fast recovery point creation, often integrated with platform backup controls<\/td><td>Restore testing and app-level consistency checks are still required<\/td><td>Virtualized or Kubernetes-backed Jenkins deployments<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Recommended backup workflow<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use a workflow that emphasizes consistency, off-host durability, and regular restore verification.<\/p>\n\n\n\n<pre class=\"mermaid\">\nflowchart TD\n    A[Backup schedule triggers] --> B[Pre-backup checks]\n    B --> C{Need strict consistency}\n    C -- yes --> D[Stop Jenkins or quiesce]\n    C -- no --> E[Proceed online]\n    D --> F[Archive JENKINS_HOME]\n    E --> F\n    F --> G[Create checksum and retain]\n    G --> H[Copy backup off-host]\n    H --> I[Test restore in non-prod]\n    I --> J[Record results]\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Example commands: filesystem backup and off-host copy<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This example prioritizes consistency by stopping Jenkins during archive creation. Adapt service name, user, and paths for your distribution or container platform.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript language-bash\"><span class=\"hljs-meta\">#!\/usr\/bin\/env bash<\/span>\n<span class=\"hljs-keyword\">set<\/span> -euo pipefail\n\nJENKINS_HOME=\/var\/lib\/jenkins\nBACKUP_ROOT=\/srv\/backups\/jenkins\nSTAMP=$(date +%F-%H%M%S)\nARCHIVE=${BACKUP_ROOT}\/jenkins-home-${STAMP}.tar.gz\n\nsudo systemctl stop jenkins\nsudo mkdir -p ${BACKUP_ROOT}\nsudo tar -C ${JENKINS_HOME} -czf ${ARCHIVE} .\nsudo systemctl start jenkins\n\nsha256sum ${ARCHIVE} | tee ${ARCHIVE}.sha256<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php language-bash\"><span class=\"hljs-comment\"># Off-host copy (example)<\/span>\nrsync -av --progress \/srv\/backups\/jenkins\/ backupuser@backup-host:\/data\/jenkins\/<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Example commands: restore on the same or a replacement host<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Always preserve the current Jenkins home before overwrite, then restore from the selected archive.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript language-bash\">BACKUP_FILE=<span class=\"hljs-regexp\">\/srv\/<\/span>backups\/jenkins\/jenkins-home<span class=\"hljs-number\">-2026<\/span><span class=\"hljs-number\">-10<\/span><span class=\"hljs-number\">-14<\/span><span class=\"hljs-number\">-010000.<\/span>tar.gz\n\nsudo systemctl stop jenkins\nsudo mv \/<span class=\"hljs-keyword\">var<\/span>\/lib\/jenkins \/<span class=\"hljs-keyword\">var<\/span>\/lib\/jenkins.pre-restore\nsudo mkdir -p \/<span class=\"hljs-keyword\">var<\/span>\/lib\/jenkins\nsudo tar -C \/<span class=\"hljs-keyword\">var<\/span>\/lib\/jenkins -xzf ${BACKUP_FILE}\nsudo chown -R jenkins:jenkins \/<span class=\"hljs-keyword\">var<\/span>\/lib\/jenkins\nsudo systemctl start jenkins<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Post-restore validation checklist<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Jenkins service is running and web UI is reachable<\/li><li>Representative jobs appear and can be opened<\/li><li>Credentials-backed jobs can authenticate to required systems<\/li><li>Required plugins load without startup errors<\/li><li>Agents\/nodes reconnect and run at least one smoke build<\/li><\/ul>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript language-bash\">sudo systemctl status jenkins\ncurl -I http:<span class=\"hljs-comment\">\/\/127.0.0.1:8080\/login<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Best practices and common pitfalls<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Test restores regularly<\/strong>; a backup is only useful if restore is proven.<\/li><li><strong>Keep at least one off-host copy<\/strong> to survive host-level loss.<\/li><li><strong>Back up credentials material together<\/strong> (<code>credentials.xml<\/code> and <code>secrets\/<\/code>).<\/li><li><strong>Document RTO\/RPO and retention<\/strong> so backup behavior matches business recovery goals.<\/li><li><strong>Avoid single-method dependency<\/strong>; combine local quick-restore copies with durable remote storage.<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>A practical Jenkins backup and restore guide for DevOps teams, covering what to back up, strategy trade-offs, and step-by-step command examples. Includes a workflow diagram and a recovery checklist you can operationalize.<\/p>\n","protected":false},"author":1,"featured_media":3353,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[42],"tags":[591,1122,545,1484,1485,145,1480,1482,1486,1483,1481,1487,822,593,592,732,104],"class_list":["post-432","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jenkins","tag-backup","tag-guide","tag-how","tag-how-to-backup-jenkins","tag-how-to-restore-jenkins","tag-jenkins","tag-jenkins-backup","tag-jenkins-backup-process","tag-jenkins-backup-tutorial","tag-jenkins-process","tag-jenkins-restore","tag-jenkins-restore-tutorial","tag-jenkins-tutorial","tag-process","tag-restore","tag-steps","tag-tutorials"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/432","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=432"}],"version-history":[{"count":5,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/432\/revisions"}],"predecessor-version":[{"id":79307,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/432\/revisions\/79307"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/3353"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}