Skip to content

Latest commit

 

History

History
98 lines (85 loc) · 5.52 KB

backup-and-restore.md

File metadata and controls

98 lines (85 loc) · 5.52 KB

Backup and Restore.

https://jfrog.com/whitepaper/best-practices-for-artifactory-backups-and-disaster-recovery/

Repositories Data.

Export.

  • Navigate to the Administration Setting Panel for modifying system-wide settings.
    • JFrog Container Registry.
      • Import & Export.
        • Select Repositories.
          • Export Repository to Path.
            • Target Local Repository.
              NOTE - Either select a specific repository or all repositories which need to be exported.
              • Select All Repositories.
            • Export Path on Server.
              • Enter /var/opt/jfrog/artifactory/data-export/repositories.
                NOTE - After export the data will be saved in ./jcr-data/data-export/repositories directory.
            • Click Export to start the Export.

Once the Export finishes we can preserve the whole ./jcr-data/data-export/repositories directory. The content from this directory will be used for Importing the data.

Import.

  • Followings conditions must be met for restore.
    • A working Jfrog Container Registry instance.
    • A repository must exists with same name.
  • Navigate to the Administration Setting Panel for modifying system-wide settings.
    • JFrog Container Registry.
      • Import & Export.
        • Select Repositories.
          Importing repositories will only import repositories data if the repository exists on the server.
          • Import Repository from Path.

            • Target Local Repository.
              NOTE - Either select a specific repository or all repositories which need to be imported.
              • Select All Repositories.
            • Import Path on Server.
              • Enter /var/opt/jfrog/artifactory/data-export/repositories.
                NOTE - Make sure you have copied the previous exported repositories data at ./jcr-data/data-export/repositories directory.
            • Click Import to start the Import.

            Once Backup is restored login to the Jfrog Container Registry instance and verify that all configurations and data are restored.

System Data.

Export.

  • Navigate to the Administration Setting Panel for modifying system-wide settings.
    • JFrog Container Registry.
      • Import & Export.
        • Select System.
          • Export Path on Server.
            • Enter /var/opt/jfrog/artifactory/data-export/system.
              NOTE - After export the data will be saved in ./jcr-data/data-export/system directory.
          • Click Export to start the Export.

Once the Export finishes we can preserve the whole ./jcr-data/data-export/system/<BACKUP_TIMESTAMP_DIRECTORY> directory. The content from this directory will be used for Importing the data.

Import.

  • Followings conditions must be met for restore.
    • A working Jfrog Container Registry instance.
  • Navigate to the Administration Setting Panel for modifying system-wide settings.
    • JFrog Container Registry.
      • Import & Export.
        • Select System.
          Importing System will erase current configuration and data and then will import new configuration and data.
          • Import System.

            • Import Zip or Path on Server.
              • Enter /var/opt/jfrog/artifactory/data-export/system/<BACKUP_TIMESTAMP_DIRECTORY>.
                NOTE - Make sure you have copied the previous exported system data at ./jcr-data/data-export/repositories directory.
            • Click Import to start the Import.

            Once the import finishes we will need to recreate the container to take the effects.

            docker-compose down
            docker-compose up -d

            Once Backup is restored login to the Jfrog Container Registry instance and verify that all configurations and data are restored.

Complete System Backup

We can use the default incremental backup daily to backup whole system data.

  • Navigate to the Administration Setting Panel for modifying system-wide settings.
    • JFrog Container Registry.
      • Services.
        • Backups. Make sure only backup-daily is enabled and others are either disabled or need to remove.
          • Edit backup-daily Backup.

            • Backup Settings.
              • Check Enabled.
              • Update the Cron Expression according to the needs.
                • For midnight at 1 AM Enter 0 0 1 ? * * *
              • Server Path For Backup.
                • Enter /var/opt/jfrog/artifactory/complete-system-backup
              • Advanced.
                • Check Send Mail to Admins if there are Backup Errors.
                • Check Incremental.
            • Click Save.

            Now the backup will runs every midnight at 1 AM. The data will be saved incrementally at ./jcr-data/complete-system-backup.

            For Import after copying the complete-system-backup directory to ./jcr-data/complete-system-backup directory. Need to use /var/opt/jfrog/artifactory/complete-system-backup/current directory as path.