Skip to content

Instantly share code, notes, and snippets.

@marcusmalmberg
Created November 14, 2012 16:45
Show Gist options
  • Save marcusmalmberg/4073235 to your computer and use it in GitHub Desktop.
Save marcusmalmberg/4073235 to your computer and use it in GitHub Desktop.
Backup/Restore heroku database

Source:
http://blog.heroku.com/archives/2009/3/18/push_and_pull_databases_to_and_from_heroku/
https://devcenter.heroku.com/articles/taps#

gem install heroku
gem install taps

# Export database from heroku
heroku db:pull --app <app-name>                   # This will replace the data specified in database.yml (most often development database)
heroku db:pull sqlite://<path> --app <app-name>   # Don't forget to add the extra "/" if you're using an absolut path


# Import database to heroku
heroku db:push --app <app-name>
@john-patrik
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment