Skip to content

Instantly share code, notes, and snippets.

@DominusKelvin
Last active October 26, 2020 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DominusKelvin/cf98a8ca93cb3586bb94503ccfacd647 to your computer and use it in GitHub Desktop.
Save DominusKelvin/cf98a8ca93cb3586bb94503ccfacd647 to your computer and use it in GitHub Desktop.
Get your local database to Heroku Postgres

Step 1: First check if the pg_dump utility is available:

pg_dump --version

Step 2: if it is, in your Sails project, run:

pg_dump -U DB_USER_NAME DB_NAME > dump.sql

Step 3: Then import the dump to your heroku app database by running:

heroku pg:psql --app APP_NAME < dump.sql

The above will import dump.sql to your database.

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