Skip to content

Instantly share code, notes, and snippets.

@pirj pirj/
Created Jan 16, 2017

What would you like to do?
Pull Heroku DB from staging/prod to local dev
psql -c "select pg_terminate_backend(pid) from pg_stat_activity where datname='LOCAL_DB_NAME'" postgres $(whoami) \
&& psql -c 'drop database LOCAL_DB_NAME' postgres $(whoami) \
&& heroku pg:pull DATABASE_URL LOCAL_DB_NAME --app APP_NAME
# Replace LOCAL_DB_NAME to say myblog_development and APP_NAME to myblog_staging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.