Install and Configure Jenkins thinBackup and Upgrade Jenkins
Today I get opportunity to upgrade jenkins, Jenkins is a very important tool for continuous integration and continuous delivery. All the Jenkins data i.e, jobs and configs are stored in JENKINS_HOME directory. Taking a periodic backup of JENKINS_HOME directory is one the best practice of Jenkins Managment. Jenkins can be extended with plugins for extra features. There is a plugin called Jenkins thinBackup Plugin. This helps in automate the backup of JENKINS_HOME Directory.
Install and Configure Jenkins thinBackup Plugin for Backup Strategy
Steps to Install the thinBackup Plugin.
1) Go to Manage Jenkins
2) Click Manage Plugins
3) Under Available Plugins tab select ThinBackup
4) Click on Install without restart button.
Steps to Configure thinBackup Plugin
1) Go to Manage Jenkins
2) Click thinBackup option
3) Click settings to configure the backup options as shown below.
4) Schedule the automated backups as shown sample below. All the configuration is self-explanatory.
Download New Jenkins War File
cd /downloads wget http://updates.jenkins-ci.org/download/war/2.9/jenkins.war
Install the New Jenkins War File
cp /downloads/jenkins.war /usr/lib/jenkins/
Store Jenkins Backups in Repository Manager like Nexus
After installing and configuring the Jenkins thinBackup plugin store the backup file in some repository manager like Nexus. So that even the server crashes, we will have the backups in one more place from where we can restore.Create a Jenkins backup job and in nexus a repo to store Jenkins Backup. Schedule the Jenkins backup job to push the backup zip file to nexus Jenkins Backup repo. Then schedule a Schedule Task in nexus for periodic cleanup of Jenkins Backup repo.
Conclusion :
We hope this Jenkins Backup strategy helps you to configure Jenkins. We shared one way of doing Jenkins Backup. There are many plugins for backup or you can write your own script to backup the JENKINS_HOME directory. We prefer thinBackup Plugin for taking Jenkins backup and then store the backups in Nexus. IF you are using some other backup strategy please share in comments, which will we be helpful to readers.