Day059 — Download all files from S3 bucket
2 min readFeb 6, 2019
I have a project that is hosted on AWS. I need to migrate it to another hosting site. So, the first thing to do is downloading all the files.
To download all files:
$ pip install awscli
$ aws configure
AWS Access Key ID: foo
AWS Secret Access Key: bar
$ aws s3 sync s3://www.website.com .
To Create Access Key:
To create a new secret access key for an IAM user, open the IAM console. Click Users in the Details pane, click the appropriate IAM user, and then click Create Access Key on the Security Credentials tab.
from https://aws.amazon.com/blogs/security/wheres-my-secret-access-key/
The S3 uri:
s3://{bucket_name}
In https://s3.console.aws.amazon.com/s3/home
, you can check the bucket name.
reference:
It is best to use virtualenv
for awscli
as recommended by the library itself.
// install python3
brew install python3touch .bashrc
alias python python3
source ~/.bashrc// download pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py// install virtualenv
pip install virtualenv// start virtual env
cd my project_dir
virtualenv ENV
source ENV/bin/activate// install awscli inside ENV
pip install awscli// end virtual env
deactivate
reference: