ruk·si

🟪 Heroku
Database Backups

Updated at 2015-09-23 10:43
# backup info
heroku pg:backups
heroku pg:backups info b017

# backup db appointed by DATABASE_URL, the primary database
heroku pg:backups capture
heroku pg:backups capture --app sushi
heroku pg:backups capture HEROKU_POSTGRESQL_PINK

heroku pg:backups cancel        # cancel running backup process
heroku pg:backups delete b101   # delete backup, usually to make more room

# backup schedules
heroku pg:backups schedules
heroku pg:backups schedule DATABASE_URL --at '16:00 America/Los_Angeles'
heroku pg:backups unschedule DATABASE_URL

# generate backup download URL that expires in 10min
heroku pg:backups public-url b001
curl -o latest.dump `heroku pg:backups public-url`
# restoring from a Heroku backup
heroku pg:backups restore b101 DATABASE_URL

# restoring from a custom backup
heroku pg:backups restore 'https://s3.amazonaws.com/bucket/mydb.dump' DATABASE