1.

How to backup and restore Jenkins data and configurations

Answer»

Backup of Jenkins is needed in case of disaster recovery, retrieving old CONFIGURATION and for AUDITING.

$JENKINS_HOME folder keeps all the Jenkins metadata.

That includes: build logs, job configs, plugins, plugin configurations etc.

Install the ‘think backup’ plugin in Jenkins and enable the backup from settings tab.We have to specify the backup directory and what we want to backup.

Backup directory: $JENKINS_HOME/backup

Backup files generated with the timestamp in the filenames will be STORED under the PATH we specified.

divya@jenkins backup]$ pwd /var/lib/Jenkins/backup uat@jenkins backup]$ls

FULL-2019-02-4_07-14 FULL-2019-02-11_13-07

It is a good PRACTICE to version control (using Git) this back-up and move it to cloud.

Restoring:

Backup files are in the tar+zip format.

Copy these over to another server; unzip and un-tar it on the server.

cd $JENKINS_HOME tar xvfz /backups/Jenkins/backup-project_1.01.tar.gz config.xml jobs/myjob/config.xml …


Discussion

No Comment Found