How To Copy Files Between AWS S3 Buckets

blur business close up code
Reading Time: 3 minutes

Hello readers, in this blog I’m going to tell you how you can transfer files from one amazon S3 bucket to another amazon S3 bucket, without having to write any script and without any code at all.

For using any AWS service you need an AWS account. Here we are assuming that you have set up the AWS account, if not visit AWS Console to create an account. Following steps will show you, how you can copy files from one bucket to another.

Step -1 Search for S3 on amazon console and create two S3 bucket.

  • After creating two S3 buckets, upload files in one bucket that you want to transfer into another bucket.
  • You can also create folder and then add files in that folder.
  • I’ve uploaded files under source bucket and my destination bucket is empty.
  • On DataSync Dashboard select Between AWS Storage services and click on Get started button.
  • Under Configuration section select Amazon S3 under location type.
  • Under region select your region.
  • In S3 bucket section select bucket from where you want to transfer files.
  • In Folder section you can select the whole folder to transfer by typing forward slash (/) or you can also transfer a particular file by typing forward slash and name of the file (/html/sample_1.html).
  • For IAM role click on Autogenerate and it will create an IAM role for you.
  • Click on Next.

Step -3 Now you have to do the same for the destination folder as we did in previous step for source folder.

Step – 4 In this step we are going to create a Task. Task is the actual thing which is going to run the transfer.

  • There is a whole bunch of options available in this step. User can change the settings according to the need.
  • For now I’m keeping all the settings as default.
  • Now click on Create Task button.
  • You’ll see the task is available now.

Step -5 Now click on Start.

  • Click on Start with defaults.
  • You’ll see the Task status will turn to running from available.
  • Click on Running to check the status.
  • After couple of minutes you will see the status will again turn to Success.
  • Now if you check your destination bucket will have all the data that source folder contains.

Conclusion

This service is mostly used when you want to transfer really large data like massive images or massive Data Warehouses stuff. I hope you like this article and it helps you in getting started with DataSync.

Written by 

Shubham Gupta is a DevOps Consultant at knoldus. He is practising Devops - Docker, Jenkins, Ansible, Kubernetes. He is passionate about DevOps technology and cloud computing.