Postgres copy Heroku Production DB to local development DB

后端 未结 6 2057
误落风尘
误落风尘 2020-12-23 11:44

I have a heroku database, d76mj7ltuqs.

I then have a local database, test_development.

The schema is the same on both of these data

6条回答
  •  醉酒成梦
    2020-12-23 12:13

    Use heroku's "pg:pull":

    You'll need to clear your local DB:

    rake db:drop
    

    Then collect some information from Heroku:

    heroku pg:pull DATABASE_URL test_development
    

    This will connect to the heroku DB, and copy it to the local database.

    See Heroku's documentation on pg:pull for more details.

提交回复
热议问题