How to copy your EOS bucket object to another E2E Account
Introduction
By default, Object storage bucket could not be simply transferred or moved to another bucket. This is true even if the destination bucket is owned by another account. In this tutorial, We are going to show the steps on how to migrate your object storage bucket from one account to another account in the myaccount portal using command line interface mc.
Step 1: Create a New Bucket on Your New Account
Go to object storage and create a new bucket where you want to copy the files/folders from your previous bucket.
Enter the name of your bucket and click on Create. We now have a bucket named "new-bucket-e2e".
Step 2: Attach Admin Permission for CLI Access
We need to attach admin permission for CLI access for both the old bucket (from where the data needs to be copied) and the newly created bucket.
Select the bucket, go to Permission, and click on Attach access key.
If you have an existing key, you can use the same, or you can create a new key to attach it to your bucket.
If you are creating a new key, make sure to note down the access key and private key as it will be displayed only once.
Here, in this case, we have attached a key named "new_bucket_key" and have given admin permission for the same.
Similarly, we followed the same steps and attached admin permission for the old bucket.
Step 3: Configure MinIO Client (mc) on Your Linux Server
To configure the MinIO client on your Linux server, please follow the steps below.
wget https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc
mv mc /usr/local/bin
Finally, verify whether the mc command is working as expected by using the below command
mc --help
Step 4: Copy the data from old bucket to new bucket
With the mc command installed, You can configure both keys on your server.
mc config host add newbucketkey https://objectstore.e2enetworks.net 4ZVRC91VTIJMX6GR33JT 95CZ196OPxxxxxxxxxxxAS3ZQFG8G6SNC1S333
mc config host add old-bucket-key https://objectstore.e2enetworks.net FCNT4DRSGMB5DEQ71KEM C6FUVZ4xxxxxxxxxxxxxxxN76SC798P23
Once the keys have been configured, replace the key name and bucket in the below command and start copying your data from your old bucket to new bucket
mc cp --recursive newbucketkey/new-bucket-e2e old-bucket-key/oldbucket-e2e