Search code examples
amazon-s3copyamazon-web-services

AWS S3 copy files and folders between two buckets


I have been on the lookout for a tool to help me copy content of an AWS S3 bucket into a second AWS S3 bucket without downloading the content first to the local file system.

I have tried to use the AWS S3 console copy option but that resulted in some nested files being missing.

I have tried to use Transmit app (by Panic). The duplicate command downloads the files first to the local system then uploads them back to the second bucket, which quite inefficient.


Solution

  • Copy between S3 Buckets

    AWS (just recently) released a command line interface for copying between buckets.

    http://aws.amazon.com/cli/

    $ aws s3 sync s3://mybucket-src s3://mybucket-target --exclude *.tmp
    ..
    

    This will copy from one target bucket to another bucket.

    See the documentation here : S3 CLI Documentation