Backing up Amazon S3 files to local storage

It’s always good to have a backup of all your files on local storage.

Usually, it’s an easy task.

But if you are using AWS it can be much harder than you expect.

This tutorial will show you how to backup the whole bucket from your AWS account to your local machine using the Command Line Interface (CLI), step by step.  

Don’t worry, it’s pretty simple.

The result is you’ll be able to back up all of your Amazon S3 files to your local storage (as pictured in the screenshot below).

backup - Full AWS bucket backup

What You’ll Need For This Tutorial

1 – AWS account

2 – AWS Command Line Interface

Video tutorial

Configure Command Line Interface (CLI)

1.1 Open command-line interpreter. 

Screenshot 205 - Full AWS bucket backup

1.2 – Enter “aws configure”

Screenshot 211 - Full AWS bucket backup

1.3 – After that you need to enter the following data:

=> AWS Access Key ID
=> AWS Secret Access Key
=> Default region name
=> Default output format

You can find how to get AWS Access Key ID and AWS Secret Access Key here.

The default region can be chosen by you.

I’ve entered up “us-east-1”.

Set default output format as “json”.

Screenshot 206 - Full AWS bucket backup

Configure local folder

2.1 – You need to choose a folder where you want to save your files.

To go to the subfolder you need to enter “cd FOLDERNAME”, to go back “cd ../”.

Screenshot 210 - Full AWS bucket backup

2.2 – When you choose the folder you will see it in command line.

Backup files

3.1 – To backup files you need to enter “aws s3 sync s3://yourbucket .”

Screenshot 213 - Full AWS bucket backup

3.2 – After that you will see the backup process.

Screenshot 208 - Full AWS bucket backup

3.3 – Go to the folder you chose and check if all files were transferred.

That’s all.

You can now back up any bucket from your AWS server and get the files onto your local hard drive. 🙂

What do you thinks about this tutorial
User Review
5 (1 vote)

Share This