Web Development

Restore database to local database.

Remember that your database should already exist.

pg_restore --clean --dbname=database_name --username=postgres1 ~/Downloads/dump


If you can’t remember how to create the backup, here’s a simple script

Create the backup

heroku pg:backups:capture -a appname
Starting backup of postgresql-acute-52332... done

Use Ctrl-C at any time to stop monitoring progress; the backup will continue running.
Use heroku pg:backups:info to check progress.
Stop a running backup with heroku pg:backups:cancel.

Backing up DATABASE to b117... done

Download the backup

You will need to get the url of the backup you just created. Here is the script to retrieve the url of your backup. You can just paste this on to your browser address bar.

heroku pg:backups public-url b117 -a appname