user1154390
user1154390

Reputation: 2429

best practice to backup config files Jenkins

I am using Jenkins on remote Debian 7.8 . I want to update Debian 7.8 to 8.7. I tried to update and it went fine however Jenkins was broken and could not start the service. I tried everything but could find any solution. Finally I used purged command and it deleted previous configurations and builds.

Now I restore the server and want to update again but I want a complete Jenkins backup of config and builds so restore it from last running instance.

What's the best practice to backup the configs as simple as possible (with less effort and problems) and configure and then merge the backuped files.

Which data / config files I have to backup?

Upvotes: 5

Views: 6029

Answers (2)

Ken
Ken

Reputation: 1985

I'd suggest using the ThinBackup plugin. https://wiki.jenkins-ci.org/display/JENKINS/thinBackup

You can set it to run on a schedule using standard cron notation. There's a few configuration options, depending how extensive (large) you want your backup to be.

Upvotes: 1

VonC
VonC

Reputation: 1329092

The exact layout used by Jenkins is described by JENKINS_HOME directory

JENKINS_HOME
 +- 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)

It comes with a simple directive:

All the settings, build logs, artifact archives are stored under the JENKINS_HOME directory. Simply archive this directory to make a back up.

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

Upvotes: 3

Related Questions