Skip to main content

Clone data between two different buckets

When migrating an S3 environment from another provider to FPT Smart Cloud's S3, or using two S3 environments in parallel, we can use Rclone or s3sync to make the data cloning process more convenient. Suppose we are using S3 Site01 and intend to switch to S3 Site02, and want to clone data from the bucket at Site01 to Site02. To do this, FPT Smart Cloud provides instructions on the following operating systems:

Clone bucket data with Linux

Step 1: Download and install Rclone:

Copysudo apt-get install rclone

Step 2: To create an rclone directory containing Site01 and Site02 information, create the rclone.conf file at the path ~/.config/rclone/rclone.conf > Edit the rclone.conf file with the following content: (Note that the provider field can be changed according to the S3 environment used, such as AWS, etc.)

Copy[site01]

type = s3

provider = Other

env\_auth = false

access\_key\_id = 00d4701ee34ab6a0967b

secret\_access\_key = SevRaN+gCPbIC6VvUjXx74mhHkbg0ZuQTFpmYTsa

endpoint = https://s3-sgn09.fptcloud.com/

acl = private

[site02]

type = s3

provider = Other

env\_auth = false

access\_key\_id = XRRS541KWS8T9DMDRCFY

secret\_access\_key = gknj5RPmgifmr4Bc90euHF8GIaZEY7xJD6bVDm7D

endpoint = https://s3-hfx03.fptcloud.com/

acl = private

Result: User guide FPT Object Storage 64 Step 3: At Site02, create a bucket with no data. Step 4: Check buckets and data at both sites through Rclone. User guide FPT Object Storage 65 Step 5: Clone data from site01:bucket-site01 to site02:bucket-site02 by:

Copy* Run the command with the --dry-run option to ensure there are no errors during the clone process.
Copyrclone sync -Pv site01:bucket-site01 site02:bucket-site02 –dry-run

User guide FPT Object Storage 66 After running the command with the --dry-run option and no errors appear > run the command without the --dry-run option

Copyrclone sync -Pv site01:bucket-site01 site02:bucket-site02

User guide FPT Object Storage 67 After the operation is successful, the customer can recheck the data and buckets at both sites through rclone. User guide FPT Object Storage 68