Backup and Restoring PostgreSQL on Heroku
Use Heroku PG Backups to backup and restore PostgreSQL database
1.Backup a Heroku PostgreSQL database
$ heroku pgbackups:capture
↪ use --expire flag to capture a new backup while automatically deleting the oldest manual backup.
$ heroku pgbackups:capture --expire
2.Downloading a backup
$ heroku pgbackups:url
↪ This will generate a temporary link to download the backup database.
3.Restore a backup
$ heroku pgbackups:restore DATABASE 'link-to-database-here'
↪ Restoring a postgres binary backup using url, don't forget the quotes for the database url.
For more information, read the Heroku PostgreSQL documentation.
Written by shinn
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Heroku
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#