Issue
- We need to restore a whole backup of a CJEMM/CJEOC
- We need to restore some files from a backup of a CJEMM/CJEOC
Environment
- CloudBees Jenkins Enterprise - Managed Master (CJEMM)
- CloudBees Jenkins Enterprise - Operations Center (CJEOC)
Resolution
To restore a backup of a CJEMM/CJEOC you have to follow these steps
-
The CJEMM/CJEOC should be started
-
Obtain the worker where the CJEMM/CJEOC is running -
cje run list-applications | grep <CJEMM-CJEOC-NAME>
-
Copy the backup file to the /tmp folder of the worker -
dna copy <BACKUP_FILE> /tmp <WORKER>
-
Connect to the worker -
dna connect <WORKER>
-
Obtain JENKINS_HOME mount point -
mount | grep <CJEMM-CJEOC-NAME>
-
List JENKINS_HOME contents -
ls -la /mnt/<CJEMM-CJEOC-NAME>/ID
-
If you will restore a whole backup
-
Make a backup of the current JENKINS_HOME -
tar -czf /tmp/currentBackup.tgz /mnt/<CJEMM-CJEOC-NAME>/ID/*
-
Remove the JENKINS_HOME content -
rm -fr /mnt/<CJEMM-CJEOC-NAME>/ID/*
-
Restore the backup -
tar -xzf /tmp/<BACKUP_FILE> -C /mnt/<CJEMM-CJEOC-NAME>/ID
-
Restart The CJEMM/CJEOC
-
If every is OK, remove the backups -
rm /tmp/<BACKUP_FILE> /tmp/currentBackup.tgz
-
If you will restore only some files
-
Make a backup of the current JENKINS_HOME -
tar -czf /tmp/currentBackup.tgz /mnt/<CJEMM-CJEOC-NAME>/ID/*
-
Restore the backup -
tar -xzf /tmp/<BACKUP_FILE> -C /mnt/<CJEMM-CJEOC-NAME>/ID <files_to_restore>
-
Restart The CJEMM/CJEOC
-
If every is OK remove the backups -
rm /tmp/<BACKUP_FILE> /tmp/currentBackup.tgz
-
NOTE Due the current issue TIGER-4473 : Backup plugin does not compress all folders with the right permissions, in case you would like to recover from backup, you might need to give the permission
drwxr-xr-x.
to all the folders inside the$JENKINS_HOME
.
1 Comments