我有一个heroku数据库, d76mj7ltuqs 。
I have a heroku database, d76mj7ltuqs.
然后我有一个本地数据库, test_development 。
I then have a local database, test_development.
这两个数据库的模式是相同的 - 我想从生产数据库中提取所有数据,
The schema is the same on both of these databases - I want to pull all of the data from my production database and overwrite my local database, so that local is an exact replica of production at the time of pull.
如何在Postgres中执行此操作?
How can I do that in Postgres?
推荐答案使用heroku的pg:pull:
Use heroku's "pg:pull":
您需要清除本地数据库:
You'll need to clear your local DB:
rake db:drop从Heroku收集一些信息:
The collect some information from Heroku:
heroku pg:pull DATABASE_URL test_development这将连接到heroku数据库,并将其复制到本地数据库。
This will connect to the heroku DB, and copy it to the local database.
有关更多信息,请参见 Heroku的有关pg:pull 的文档详情。
See Heroku's documentation on pg:pull for more details.
更多推荐
Postgres将Heroku Production DB复制到本地开发DB
发布评论