Skip to content

Instantly share code, notes, and snippets.

@maml
Created February 20, 2017 02:39
Show Gist options
  • Save maml/662fb76270fc512e6900ace313407e90 to your computer and use it in GitHub Desktop.
Save maml/662fb76270fc512e6900ace313407e90 to your computer and use it in GitHub Desktop.
rails, dump db & upload to heroku
# dump your db, note: the heroku command failed for me without the --format=c flag being set.
pg_dump --no-acl --no-owner --format=c database_name > db.dump
# in my case I have a remote, staging, I want to upload to
heroku pg:backups restore 'url_for_db.dump' DATABASE_URL -r staging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment