Your Uncommonly Amazing WordPress Tech Partner

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

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

1.2 – Enter “aws configure”

Screenshot

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

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

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

3.2 – After that you will see the backup process.

Screenshot

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)

You may also enjoy...

WordPress based membership sites have certain requirements, and make use of certain applications that, in my experience, makes most of the popular hosting providers a poor choice.
Announcing our new MemberFix WordPress & Membership Site Care Plans…

WordPress updates breaking your site? If you’ve been updating your WordPress plugins and themes regularly, you’ve probably accidentally broken your site—or a client’s site—at least once. The most common issues

Remember the course roadmap that used to be found inside of the Member Site Academy? Learn how to recreate is using Elementor in this guide!

2 Responses

  1. Nice one! Thanks! Any chance to have a tutorial how to restore files from local backup to s3? Are all file rights included there? Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *