Manually backing up and restoring the registry

🌐 This document is available in both English and Ukrainian. Use the language toggle in the top right corner to switch between versions.

1. Backing up registry

It’s vital to schedule backups when your system is least busy. We recommend doing this at night. This way, everything will proceed smoothly and without any inconveniences.

After a successful deployment of the registry and regulations, the Platform administrator can create a backup of the registry, which will be stored in a secure backup repository—MinIO.

To back up a registry this, follow these steps:
  1. Log in to the Control Plane using the previously created login and password.

  2. Go to the Registries section and select the registry for backup.

  3. Open the Configuration section at the Registry information tab, click on the link under CI to open Jenkins, navigate to the All tab, and find the job named Create-registry-backup-<registry-name> where <registry-name> means the name for your registry (see the image below).

    For more details on Jenkins jobs, see Checking registry deployment details

    control plane create backup job

  4. Open the job and click Build with Parameters to launch the Create-registry-backup pipeline.

    control plane create backup 01

  5. Click Build.

    control plane create backup 02

    control plane create backup 03

    If the job is successfully executed, a backup of the registry with its regulations is created and uploaded to the corresponding backup repository directory.

Backup replication of S3 buckets

After the backup creation pipeline has run, it establishes bucket replication pipelines. These pipelines are scheduled to run at 19:30 (UTC) by default. If you need to launch the pipeline earlier, you can manually modify this schedule:

  1. Log into OKD.

  2. In the top-right corner, click Copy login command > Display Token.

  3. In the Log in with this token field, copy the token to log into OpenShift through the terminal. It might look like this:

    Example of oc login
    oc login --token=sha256~gQa0bxg_aaabbbcccd_D88470E-aabBcQuCn9keIM4I --server=https://api.envone.dev.registry.eua.gov.ua:1234
  4. Open the OpenShift CLI and execute the copied command.

    For more information about OpenShift CLI, refer to the guide Getting Started Preparations.
  5. Start the replication backups of the S3 buckets with the schedule desired by the user. To do this, run the following command:

    namespace="abc-02";schedule='19 12 * * *'; for cronJob in `oc get cronjob -n velero -o custom-columns="NAME:.metadata.name" --no-headers | grep "${namespace}"`;do oc -n velero patch cronjob/$cronJob -p '{"spec":{"schedule":"'$schedule'"}}'; echo 1;done
    Replace the value namespace="abc-02" with the name of your registry. For example, namespace="test-registry".
Also, familiarize yourself with the settings for automatic setup of S3 bucket replications on the page Setting up the registry components backup schedule and retention time.

2. Restoring registry

To restore a registry from the created backup, follow these steps:
  1. Log in to the Control Plane using the previously created login and password.

  2. Go to the Registries section and select the Registry that needs to be restored.

  3. Go to the Configuration section, click on the link under CI to open Jenkins, navigate to the All tab, and find the Restore-registry-<registry-name> job, where <registry-name> means the name for your registry (see the image below).

    control plane create restore

  4. Open the job and click Build with Parameters to launch the Restore-registry pipeline.

    control plane create restore 01

  5. Click Build.

    control plane create restore 02

  6. Next, in the parameter input step, select the backup version to restore. To do this, go to the Console Output section on the left panel and click Input Requested.

    control plane create restore 03

  7. Select the backup version from the list and click Proceed.

    control plane create restore 04

    If the Restore-registry pipeline is successfully executed, the registry will be restored to the selected backup version.

    control plane create restore 05