How can I import a .sql file into my Heroku postgres database?

Viewed 39233

I have a backup sql file from another database that I want to import into Heroku's postgres database. How do you do that?

5 Answers

Django local db import on Heroku on windows

create backup

pg_dump -U postgres -d hawkishfinance > C:\Users\Fauzan\Projects\hawkishfinance.sql

dump on server

heroku pg:psql --app hawkishfinance < hawkishfinance.sql 

You must add run in this command. It will work successfully!

heroku pg:psql run --app YOUR_APP_NAME_HERE < updates.sql
Related