Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Move files directly from one S3 account to another?

Pretty basic question but I haven't been able to find an answer. Using Transit I can "move" files from one S3 bucket on one AWS account to another S3 bucket on another AWS account, but what it actually does is download the files from the first then upload them to the second.

Is there a way to move files directly from one S3 account to another without downloading them in between?

like image 673
Andrew Avatar asked Apr 01 '11 19:04

Andrew


People also ask

How do I transfer files from one S3 account to another?

Open AWS CLI and run the copy command from the Code section to copy the data from the source S3 bucket. Run the synchronize command from the Code section to transfer the data into your destination S3 bucket. Your data is then copied from the source S3 bucket to the destination S3 bucket.

Can you copy data from one S3 bucket to another?

Depending on your use case, you can perform the data transfer between buckets using one of the following options: Run parallel uploads using the AWS Command Line Interface (AWS CLI) Use an AWS SDK. Use cross-Region replication or same-Region replication.

Which S3 feature allows you to move files between different S3 storage classes?

You can also use S3 Lifecycle policies to automatically transition objects between storage classes without any application changes. Key Features: Same low latency and high throughput performance of S3 Standard.


1 Answers

Yes, there is a way. And its pretty simple, though it's hard to find it. 8)

For example, suppose your first account username is [email protected] and second is [email protected].

Open AWS Management Console as acc1. Get to the Amazon S3 bucket properties, and in the "Permissions" tab click "Add more permissions". Then add List and View Permissions for "Authenticated Users".

Next, in AWS IAM (it's accessible from among the console tabs) of acc2 create a user with full access to the S3 bucket (to be more secure, you can set up exact permissions, but I prefer to create a temporary user for the transfer and then delete it).

Then you can use s3cmd (using the credentials of the newly created user in acc2) to do something like:

s3cmd cp s3://acc1_bucket/folder/ s3://acc2_bucket/folder --recursive 

All transfer will be done on Amazon's side.

like image 84
side2k Avatar answered Oct 01 '22 10:10

side2k