Object Storage Swift - Syncing object containers
Objective
If you want to move your objects from one data centre to another, or even from one project to another, syncing objects between containers is the best solution for avoiding service disruptions during your migration. This guide explains how you can implement this solution.
Requirements
- An environment that is ready to use the OpenStack API with the Swift client
- OpenStack environment variables set
- Two object containers in two different data centres
Instructions
If your container contains objects larger than 5 GB, your two containers must have the same name. In addition, the synchronisation configuration must also be applied to the container that contains the segments.
Configuring the sync
Creating a sync key
For containers to authenticate, you will need to create a key and configure it on each object container.
- Create the key:
Destination container configuration
First of all, you will need to configure the key on the container that will receive the data. In our case, the destination container is in BHS.
- Check the region that has loaded in the environment variables:
- Configure the key on the destination container:
- Next, check that the key has been successfully configured using the following command, and note down the content of the "Account" variable at the same time:
- Retrieve the target container’s address, then configure it on the source container (this one is:
//OVH_PUBLIC_CLOUD/Region/Account/Container).
Source container configuration
- Change the region in the environment variables:
- Configure the key on the source container:
- Configure the recipient container on the source container:
- As detailed previously, you can check that it has been configured properly using the following command:
Checking the sync
After a few minutes (depending on the number and size of the files to be sent), you can check whether the sync is successful by simply listing the files in each container.
- To list the files on the source container:
- To list the files on the destination container:
Reversing the synchronisation between two containers
In order to reverse the synchronisation between two containers, you need to remove the --sync-to metadata from the source container, and redeclare it on the other container, which will then become the new source container.
Don't forget to also change the region in the new "sync-to" URL.
Stop synchronisation between two containers
In order to stop synchronisation between two containers, you need to remove the --sync-key and --sync-to metadata:
You can also use this guide for migrating RunAbove objects to the OVHcloud Public Cloud.
Go further
For training or technical assistance implementing our solutions, contact your sales representative or visit our Professional Services page to request a quote and have your project analysed by our experts.
Join our community of users.