Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is is possible to move/copy an s3 bucket to a different account?

Does Amazon provide a way to copy a bucket from one account to a different account? I am uploading several gb of files to my own bucket for a client app for development purposes, but when handing off the code I'm going to want to switch the bucket to their account (so I am no longer paying for the storage). Uploading is taking quite awhile because there are many small files, and I would like to avoid the same arduous process later, when I move the files into the other bucket.

like image 382
bantic Avatar asked Aug 10 '09 15:08

bantic


People also ask

Can we move S3 buckets to a different region or account?

The short answer is you can't migrate a S3 bucket from one region to another.

Are S3 buckets unique across accounts?

Amazon S3 supports global buckets, which means that each bucket name must be unique across all AWS accounts in all the AWS Regions within a partition. A partition is a grouping of Regions.


2 Answers

You could use crossftp ( http://www.crossftp.com/ ) to server transfer it from one account to another. But you will still have to pay the traffic.

other solution would be: http://gallery.bucketexplorer.com/displayimage-93.html

like image 153
Rufinus Avatar answered Nov 04 '22 08:11

Rufinus


boto works well. According to the creator of boto:

Assuming you have account A and account B and all of the objects are currently stored in a bucket owned by account A, you should be able to grant account B read access to the existing bucket(s) and then, using the account B credentials COPY the objects into a bucket(s) owned by account B. I think something like this should work:

 conn = S3Connection(...) source_bucket =
 conn.lookup(source_bucket_name) dest_bucket =
 conn.lookup(dest_bucket_name) source_key =
 source_bucket.lookup(key_name) dest_key = source_key.copy(dest_bucket,
 key_name, preserve_acl=True)

This would create a key of the same name in the destination bucket and would also preserve the source key's ACL and metadata.

like image 42
Rose Perrone Avatar answered Nov 04 '22 07:11

Rose Perrone