Migrate to a new storage backend

Your metadata store and your storage both persist when you migrate your data to a new storage backend. Unlike previous versions of the product, MSR 2.9.x requires the new storage backend to contain an exact copy of the data for the prior configuration. If you do not meet the requirement you must reinitialize the storage using the --reinitialize-storage option with the dtr reconfigure command, which initializes a new metadata store and erases your existing tags.

As a best practice, you should always move, back up, and restore MSR storage backends together with your metadata.

To migrate data to a new storage backend:

  1. Disable garbage collection:

    1. Log in to the MSR web UI.

    2. From the left-side menu, navigate to System > Garbage Collection.

    3. Select Never Disable garbage collection to ensure that any blobs referenced in the backup you create will persist.

      Important

      Garbage collection must remain disabled throughout metadata backup and the migration of your storage data.

    4. Click Save.

  2. Back up your existing metadata.

  3. Migrate the contents of your current storage backend to the new one.

  4. Restore MSR from your backup, specifying your new storage backend.

  5. Run the garbage collection operation to address any dangling blobs:

    curl -u <username>:$TOKEN -X POST "https://<msr-url>/api/v0/jobs" -H "accept: application/json" -H "content-type: application/json" -d "{ \"action": \"onlinegc_blobs\" }"
    

Upon success of your data migration, you will receive a 202 Accepted response with a job id and other related details.

If you have a longer maintenance window, you can perform a simpler version of data migration:

  1. Put MSR in read-only mode:

    curl -u <username>:$TOKEN -X POST "https://<msr-url>/api/v0/meta/settings" -H "accept: application/json" -H "content-type: application/json" -d "{ \"readOnlyRegistry\": true }"
    

    Upon success, you will receive a 202 Accepted response.

  2. Migrate the contents of your current storage backend to the new one.

  3. Reconfigure MSR using the reconfigure command with the --storage-migrated option to preserve your existing tags. For reconfigure command usage details, refer to <msr-cli-reconfigure>.