JENKINS BACKUP AND RESTORE

Backup Jenkins Data :-

→ Go to jenkins home(/var/lib/jenkins/) and create backup folder on that one.

Mkdir /var/lib/jenkins/Backup_jenkins/

chown -R jenkins:jenkins /var/lib/jenkins/Backup_jenkins/

→ open Jenkins URL (http://x.x.x.x:8080)

→ open Manage jenkins → Manage Plugins → click available → select Backup plugin → install backup plugin.

→ configure the Backup Plugin – open Manage Jenkins → Backup Manager → click on setup

→ click on backup Hudson configuration file.

Restore Jenkins data :-

→ copy the backup .zip file in target jenkins server.

Scp -r /var/lib/jenkins/Backup root@y.y.y.y:/root/

→ Download and install jenkins in target server

→ replace jenkins home(/var/lib/jenkins) into backup folder.

→ change permissions into jenkins in backup folder.

→ restart the jenkins server

systemctl restart jenkins.service