Created
February 21, 2021 13:03
-
-
Save timbophillips/c6ee78d01b2680e4174faeb75280d764 to your computer and use it in GitHub Desktop.
download / backup a Heroku cloud postgresql database to a *text* psql file
This file contains 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
#!/bin/bash | |
HEROKU_APP_NAME=app-name | |
OUTPUT_SQL_FILENAME=~/Downloads/myDB.psql | |
heroku pg:backups:capture --app $HEROKU_APP_NAME | |
heroku pg:backups:download --app $HEROKU_APP_NAME | |
pg_restore ./latest.dump -f $OUTPUT_SQL_FILENAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment