Postgres将Heroku Production DB复制到本地开发DB

编程入门 行业动态 更新时间:2024-10-24 22:20:06
本文介绍了Postgres将Heroku Production DB复制到本地开发DB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个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

本文发布于:2023-10-18 11:22:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1504091.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Heroku   Postgres   DB   Production

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!