Skip to content

Instantly share code, notes, and snippets.

@lpf23
Last active August 29, 2015 14:01
Show Gist options
  • Save lpf23/59d7d2f5bae1ec0e86fe to your computer and use it in GitHub Desktop.
Save lpf23/59d7d2f5bae1ec0e86fe to your computer and use it in GitHub Desktop.
Heroku DB Commands
heroku pgbackups:capture DATABASE --app app1 --expire
1) heroku maintenance:on --app app1
2) heroku pg:reset DATABASE --app app1 --confirm app1
3) heroku pgbackups:url --app app2
3a) copy result with double quotes for use in next command
4) heroku pgbackups:restore DATABASE <string from previous command with double quotes> --app app1 --confirm app1
5) heroku run:detached rake db:migrate --app app1
6) heroku maintenance:off --app app1
7) heroku restart --app app1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment