Created
September 15, 2012 00:10
-
-
Save joeybaker/3725709 to your computer and use it in GitHub Desktop.
Import a DB from Heroku. Only, be fast about.
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
#! /bin/bash | |
# | |
# You should do a find/replace for APPNAME, LOCALDBUSER, and LOCALDBNAME | |
# | |
# via https://devcenter.heroku.com/articles/pgbackups#importing-from-a-backup, https://github.com/heroku/heroku/issues/556 | |
# by: @joeybaker | |
heroku pgbackups:capture --expire --app APPNAME | |
curl -o latest.sql `heroku pgbackups:url --app APPNAME` | |
pg_restore --verbose --clean --no-acl --no-owner -U LOCALDBUSER -d LOCALDBNAME latest.sql | |
rm latest.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment