Created
May 10, 2024 21:57
-
-
Save jdowning/90e4da884b240d324a284a9d28d6b093 to your computer and use it in GitHub Desktop.
Create a Postgres dump and transfer to your local workstation
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
# Bonus: you could use jq and save the value in env vars to be passed into later commands | |
❯ heroku api post /sources | |
POST api.heroku.com/sources... 201 | |
{ | |
"source_blob": { | |
"get_url": "presigned_s3_GET_url", | |
"put_url": "presigned_s3_PUT_url" | |
} | |
} | |
❯ heroku run 'pg_dump -Fc --no-acl --no-owner --quote-all-identifiers --table table $DATABASE_URL > db.dump; echo $(shasum db.dump); curl -s -X PUT -T db.dump "presigned_s3_PUT_url"' --app sushi | |
Running pg_dump -Fc --no-acl --no-owner --quote-all-identifiers --table table $DATABASE_URL > db.dump; echo $(shasum db.dump); curl -X PUT -T db.dump "presigned_s3_PUT_url" on ⬢ sushi... up, run.5215 (Private-M) | |
457c22dd0d82361de56c23dcbf48a17bddca95fa db.dump | |
❯ curl -s -X GET -o db.dump "presigned_s3_GET_url" ; shasum db.dump | |
457c22dd0d82361de56c23dcbf48a17bddca95fa db.dump |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment