How to import a Heroku PG dump into local machine

前端 未结 5 951
小鲜肉
小鲜肉 2020-12-04 12:25

I\'m trying to import my production Heroku database into my development machine.

My local db is PostgreSQL.

First, I\'m exporting the dump from Heroku to my

5条回答
  •  抹茶落季
    2020-12-04 13:15

    Heroku export the .dump extension file of the db to import in any of the relational DB by having its own norms and conditions. While importing it to the local postgres DB, first you download the file latest.dump into your local machine and then run

    pg_restore -h localhost -p 5432 -U postgres_username -d db_name -v latest.dump
    

    and restart the rails server.

提交回复
热议问题