Skip to content

Instantly share code, notes, and snippets.

@vincefav
Last active June 22, 2018 22:42
Show Gist options
  • Save vincefav/d3a470f64d2a3a67df764d136f3c61b6 to your computer and use it in GitHub Desktop.
Save vincefav/d3a470f64d2a3a67df764d136f3c61b6 to your computer and use it in GitHub Desktop.
Postgres: How to restore latest.dump from Heroku to local server in Windows
Type the following from your command line:
pg_restore --no-privileges --no-owner -U postgres -d [YOUR_DB_NAME] -1 latest.dump
@vincefav
Copy link
Author

vincefav commented Jun 22, 2018

I spent two hours searching for how to do this, so I'm sharing the command publicly. Hopefully it pops up for future users who find themselves in my predicament. :)

Things you should know:

  • Your database should exist already. It won't be created for you.
  • Replace "postgres" with your postgres username. "postgres" is the default.
  • This assumes your command line is in the same directory as the latest.dump file.

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