From f39d3c7f88cd3dc639ac948717eb20139eb6f35c Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Thu, 24 Jun 2021 16:34:58 +0200 Subject: [PATCH] Move script, update readme --- README.md | 28 ++++++++++++++++++++++++ archive-backup.sh => bin/pg-backup-to-s3 | 0 2 files changed, 28 insertions(+) rename archive-backup.sh => bin/pg-backup-to-s3 (100%) diff --git a/README.md b/README.md index 0f7a0002..4f795dc8 100644 --- a/README.md +++ b/README.md @@ -230,3 +230,31 @@ python manage.py export_schema_for_cypress ``` python manage.py export_schema_graphql ``` + + +## Backup to S3 + +From https://pawelurbanek.com/heroku-postgresql-s3-backup + +### Initial setup per Heroku Dyno + +``` +heroku buildpacks:add heroku-community/awscli +heroku config:set BACKUP_AWS_ACCESS_KEY_ID=[Your AWS Access Key ID] +heroku config:set BACKUP_AWS_SECRET_ACCESS_KEY=[Your AWS Secret Access Key] +heroku config:set BACKUP_S3_BUCKET_NAME=[Your S3 bucket name] +``` + +``` +heroku authorizations:create => TOKEN +heroku config:set HEROKU_API_KEY=[TOKEN] +heroku buildpacks:add heroku-community/cli +``` + +``` +heroku config:set APP_NAME=app-name +``` + +``` +heroku config:set PG_BACKUP_PASSWORD=$(openssl rand -base64 32) +``` diff --git a/archive-backup.sh b/bin/pg-backup-to-s3 similarity index 100% rename from archive-backup.sh rename to bin/pg-backup-to-s3