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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With