有没有比 Taps 更快的方法从 Heroku 中提取生产数据? [英] Is There A Faster Way To Pull Production Data From Heroku Than Taps?

查看:21
本文介绍了有没有比 Taps 更快的方法从 Heroku 中提取生产数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常需要克隆生产数据来调查错误.即使数据库大小微不足道,heroku db:pull (taps) 也需要 5 分钟以上的时间,而且似乎很有可能失败.是否有其他方法可以拉取数据库?

I often need to clone production data to investigate bugs. Even with a trivial database size heroku db:pull (taps) takes 5+ minutes and seems to have a high chance of failing. Is there an alternative method to pull the database?

替代流程/文章的图书馆也将不胜感激.

Libraries for alternative processes / articles would also be appreciated.

推荐答案

查看 pgbackups.它已经取代了 Heroku bundle 命令,并将为您提供与 mysqldump 等效的 postgres.对于大型数据集,这比 Taps 文明得多.

Check out pgbackups. It has replaced the Heroku bundle command and will give you a the postgres equivalent of mysqldump. This is far more civilized than Taps for large datasets.

heroku pgbackups:capture

将创建一个转储文件并存储它.要下载转储文件,您需要获得的网址

Will create a dumpfile and store it. To download the dumpfile you need the url which you get with

heroku pgbackups:url b001 (or whatever the id number of the backup is)

这将返回一个 url,您可以从中下载您的转储.如果需要,您可以将其粘贴到 Firefox 中,或者按照他们的建议使用 curl/wget.使用 pg_restore 将转储文件加载到您的数据库中,正如他们在文档中所说:

That will return an url from which you can download your dump. You can paste it into Firefox if you want or use curl/wget like they suggest. The use pg_restore to load the dump file into your database as they say in the docs:

pg_restore --verbose --clean --no-acl --no-owner -h localhost -U test_user -d myapp_development /home/mike/Downloads/b001.dump

pg_restore:连接数据库进行恢复

pg_restore: connecting to database for restore

这篇关于有没有比 Taps 更快的方法从 Heroku 中提取生产数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆