How to restore a Managed Master(CJEMM) or Operations Center(CJEOC) backup on CJE

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

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
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.