Migrate to a new storage backend#
Your metadata store and your storage both persist when you migrate your data to
a new storage backend. MSR 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:
-
Disable garbage collection:
-
Log in to the MSR web UI.
-
From the left-side menu, navigate to System > Garbage Collection.
-
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.
-
Click Save.
-
-
Migrate the contents of your current storage backend to the new one.
-
Restore MSR from your backup, specifying your new storage backend.
-
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:
-
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 Acceptedresponse. -
Migrate the contents of your current storage backend to the new one.
-
Reconfigure MSR using the
reconfigurecommand with the--storage-migratedoption to preserve your existing tags. Forreconfigurecommand usage details, refer to registry.mirantis.com/msr/dtr reconfigure.