I'd like to backup all Jenkins jobs and config files. What's the easiest way of doing it?

  • What did you try?
    – 030
    Commented Apr 26, 2018 at 22:12
  • 3
    I tried this.
    – kenorb
    Commented Apr 26, 2018 at 22:13

9 Answers 9


There are many ways to do this but the easiest way I can think of is doing a backup of the Jenkins home folder.

You can see where your Jenkins home folder is located with:

su jenkins

And for example, if you only want to backup the jobs you can go to:


And make a backup of that folder.

The configuration files are stored as a bunch of XML files.

If you are using the official Jenkins docker image, the home will be at /var/jenkins_home.

  • 2
    I needed to switch to the jenkins user to have access to the $JENKINS_HOME environment variable: sudo su -s /bin/bash jenkins, and then echo $JENKINS_HOME, which for me was /var/lib/jenkins Commented Sep 25, 2017 at 18:00
  • 6
    The problem with backing up the whole folder 'jobs' is that also the job executions will be copied - this may mean many GB. Commented Oct 22, 2017 at 8:56
  • Whether the service of Jenkins should restart?
    – Xin Meng
    Commented May 4, 2018 at 15:35
  • Jenkins home in MacOS (Homebrew default installation): ~/.jenkins Commented Apr 13, 2019 at 14:16
  • 2
    wiki.jenkins.io/display/JENKINS/Administering+Jenkins has a Backup/Restore section, let me quote it: Back up and restore All the settings, build logs, artifact archives are stored under the JENKINS_HOME directory. Simply archive this directory to make a back up. Similarly, restoring the data is just replacing the contents of the JENKINS_HOME directory from a back up. Back ups can be taken without stopping the server, but when you restore, please do stop the server.
    – coz
    Commented Aug 16, 2021 at 13:06

All jobs (jobs/) and master config files (config.xml) can be found in Jenkins home folder (JENKINS_HOME ) in the following structure:

 +- config.xml     (jenkins root configuration)
 +- *.xml          (other site-wide configuration files)
 +- userContent    (files in this directory will be served under your http://server/userContent/)
 +- fingerprints   (stores fingerprint records)
 +- plugins        (stores plugins)
 +- workspace (working directory for the version control system)
     +- [JOBNAME] (sub directory for each job)
 +- jobs
     +- [JOBNAME]      (sub directory for each job)
         +- config.xml     (job configuration file)
         +- latest         (symbolic link to the last successful build)
         +- builds
             +- [BUILD_ID]     (for each build)
                 +- build.xml      (build result summary)
                 +- log            (log file)
                 +- changelog.xml  (change log)

Most of the config are in XML format, so backing all .xml files should be enough.

All the settings, build logs, artifact archives are stored under the JENKINS_HOME directory. Simply archive this directory to make a back up. Similarly, restoring the data is just replacing the contents of the JENKINS_HOME directory from a back up.

Back ups can be taken without stopping the server, but when you restore, please do stop the server.

For consistent backups it is good practise to keep JENKINS_HOME directory under Git repository.

For example:

git init
shopt -s globstar
git add **/config.xml
git commit -m'Added job config files' -a

and pushing the files to the external repository. You can also add the following .gitignore file to ignore some files.

Related: Is there a way to keep Hudson / Jenkins configuration files in source control?

  • How often do you create a backup? Do you push the code automatically to a git repository? If true, do you create a Pull Request that has to be merged manually (manual intervention) to do some backup integrity check?
    – 030
    Commented Apr 26, 2018 at 22:16
  • 2
    @030 Usually manually after some major changes, when I know the config is stable and I need to backup it, as Jenkins often likes to break things, such as changing slaves from unix to windows by it-self, removing passwords from forms, so having them in git/GitHub, I can easily compare and find the missing data and add it back or revert some specific file. There are some plugins to keep history changes, but I didn't find it useful.
    – kenorb
    Commented Apr 26, 2018 at 22:19
  • You store the passwords in git? Do you encrypt them? Do you use pipelines aka Pipeline as Code as well?
    – 030
    Commented Apr 26, 2018 at 22:23
  • 3
    @030 Jenkins encrypts passwords/credentials by default, but you can easily decrypt them. However, without the master key (which should be not part of the backup) or access to Jenkins, nobody else can. I'm not using Pipeline as Code.
    – kenorb
    Commented Apr 26, 2018 at 22:24
  • How do you test the integrity of this backup in git? E.g. do you spin up a virtual machine or docker system, mount the git repo and check whether everything still works?
    – 030
    Commented Apr 26, 2018 at 22:27

If your Jenkins jobs are defined in a Jenkinsfile you can store it in a git repository and have it loaded up by using Pipeline.

Unfortunately, since not all Jenkins plugins support Jenkinsfile and Pipeline, you will need to manually create new Jenkinsfiles if you wish to move existing jobs to this format.

  • Re "you will need to manually create": There's the Convert To Pipeline plugin. Though it doesn't work for all kinds of projects/configurations, it's worth to give it a try first. Commented Oct 29, 2021 at 23:37
  • Yes, but there is additional configuration on top of that that is just stored in .xml config files, such as the repo url to find the jenkinsfile, log rotation, triggers, branch properties, etc.
    – cowlinator
    Commented May 23 at 0:49

The SCM Sync Configuration Plugin does exactly what you wish. Works with either svn or git to backup your jenkins core and job configuration, so gives you easy tracking as to who made changes, as well as a backup.

  • 1
    I literally tar the $JENKINS_HOME folder, but this seems soooo much better.
    – MrMesees
    Commented Apr 14, 2017 at 21:18
  • 3
    That plugins seems pretty inactive/dead - is it really functional and on-par as of 2017? Commented Oct 23, 2017 at 9:35
  • The SCM Sync Configuration plugin is deprecated: "In general, this means that this plugin is either obsolete, no longer being developed, or may no longer work.". Commented Oct 29, 2021 at 23:42

I'm using scripts from sue445/jenkins-backup-script.

It archives Jenkins settings and plugins such as:

  • $JENKINS_HOME/*.xml
  • $JENKINS_HOME/jobs/*/*.xml
  • $JENKINS_HOME/nodes/*
  • $JENKINS_HOME/plugins/*.jpi
  • $JENKINS_HOME/secrets/*
  • $JENKINS_HOME/users/*


./jenkins-backup.sh /path/to/jenkins_home archive.tar.gz

# add timestamp suffix
./jenkins-backup.sh /path/to/jenkins_home backup_`date +"%Y%m%d%H%M%S"`.tar.gz

There are few ways to backup jenkins data and master configurations. The best way for backup is to use the Thinbackup plugin. You can schedule timely backups using cron expressions. You can configure full backup and incremental backup as well.

Another way to backup data and config is to take the disk snapshot of your jenkins master server. The ideal way to do this by mounting a disk and link the jenkins config directory to the disk mount point

Both the scenarios are well explained in this blog post. You will get a better idea and steps for the configurations.


You can try the thinBackup plugin (even though it is not actively maintained) [if taking a logical backup is all you want] (i.e. most of the config xml files, jobs, nodes etc). The backup size won't be huge.


I needed to migrate a Jenkins from one Windows Server instance to another. Finally I managed to do it like that:

  • Stop the Jenkins service (if you can afford it)
  • Copy the entire Jenkins folder (by default C:\Program Files x86\Jenkins)
  • Paste onto the new instance
  • Go inside the directory and run jenkins.exe install

This will register the freshly pasted Jenkins as a service on the new machine and will work 100% the same.

If this works then if you need a backup just for future safety, copy the Jenkins folder somewhere. It will work like a snapshot.


I summarized how to backup Jenkins using file system snapshots and find this method the most effective and secure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.