Last active
August 3, 2021 23:27
-
-
Save osw4l/0f7c37507a4f20d898b701b7268148ce to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# heroku backup | |
heroku pg:backups:capture --app heroku_app_name | |
heroku pg:backups:download --app heroku_app_name | |
# when the latest.dump are downloaded | |
pg_restore --verbose --clean --no-acl --no-owner -h my_rds_host -U user -d db latest.dump | |
# download backup from remote database | |
pg_dump -h host -U user -C db --file=db_backup.dump | |
# rds backup | |
pg_dump -h host -Fc -U user db > db_backup.dump | |
# gzip rds backup | |
pg_dump -h host -Fc -U user db | gzip > file.gz | |
# load backup .gz in local | |
gunzip -c db.gz | pg_restore --verbose --clean --no-acl --no-owner -U user -d db -p 5432 | |
# load backup .gz in remote host | |
gunzip -c db.gz | pg_restore --verbose --clean --no-acl --no-owner -h my_rds_host -U user -d db -p 5432 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment