无法从转储导入到heroku postgres数据库 [英] Can't import to heroku postgres database from dump
问题描述
对不起,如果它是重复的,但我试图在这里找到答案,没有什么帮助。
所以我读过了像这和这个。我能够保存一个转储文件,我使用 pg:backups capture
命令创建了这个转储文件。将其上传至s3并试图用以下方式恢复:
heroku pg:备份恢复DATABASE'https:// s3-eu- west-1.amazonaws.com/somebucket/uploads/tmp/b011.dump'
但它只是不工作!在控制台中它会记录:
未知数据库:https://s3-eu-west-1.amazonaws.com/somebucket/上传的/ tmp / b011.dump。有效选项为:DATABASE_URL,HEROKU_POSTGRESQL_SILVER_URL
尝试列出选项而不是 DATABASE
,但结果相同。我也尝试了其他托管服务,但结果也一样。我也尝试从其他应用程序恢复它,如下所示:
heroku pg:备份恢复myapp :: b001 HEROKU_POSTGRESQL_SILVER --app myapp-cedar
但没有找到 Backup oncampus :: b001。 然而,命令
heroku pg:backups --app myapp
表明它存在。
===备份
ID备份时间状态大小数据库
---- ----------------- -------- ---------------------------------- -------- ------
b001 2015-03-13 18:10:14 +0000已完成2015-03-13 18:10:22 +0000 9.71MB ORANGE
现在不知道该怎么做。只希望有人能帮助我。
命令的参数顺序非常重要。在上面的第一个示例中,您有 heroku pg:备份还原DATABASE'https://s3-eu-west-1.amazonaws.com/somebucket/uploads/tmp/b011.dump'
,但该命令期望引用FIRST和db加载到第二个,这将给 heroku pg:备份恢复'https://s3-eu-west-1.amazonaws.com /somebucket/uploads/tmp/b011.dump'DATABASE
来代替。我认为新的东西ID可能比URL更受欢迎,但只要该URL可访问,URL就应该工作。希望有帮助,否则让我知道,我们可以尝试一些其他的东西。
Sorry if it is a duplicate, but I tried to find an answer here, and nothing helped.
So I've read heroku articles like this and this. I was able to save a dump file, which I've created with pg:backups capture
command. Uploaded it to s3 and tried to restore it with:
heroku pg:backups restore DATABASE 'https://s3-eu-west-1.amazonaws.com/somebucket/uploads/tmp/b011.dump'
But it just do not work! In console it logs:
Unknown database: https://s3-eu-west-1.amazonaws.com/somebucket/uploads/tmp/b011.dump. Valid options are: DATABASE_URL, HEROKU_POSTGRESQL_SILVER_URL
Tried listed options instead of DATABASE
, but with the same result. Also I've tried other hosting, but with the same result, again. I also tried to restore it from other app, like this:
heroku pg:backups restore myapp::b001 HEROKU_POSTGRESQL_SILVER --app myapp-cedar
But it logs with Backup oncampus::b001 not found.
However, command heroku pg:backups --app myapp
shows that it is present.
=== Backups
ID Backup Time Status Size Database
---- ------------------------- ---------------------------------- ------ --------
b001 2015-03-13 18:10:14 +0000 Finished 2015-03-13 18:10:22 +0000 9.71MB ORANGE
Don't know what to do now. Just hope someone will help me.
The order of arguments to the command is significant. In the first example above, you have heroku pg:backups restore DATABASE 'https://s3-eu-west-1.amazonaws.com/somebucket/uploads/tmp/b011.dump'
, but the command expects the reference FIRST and the db to load into second, which would give heroku pg:backups restore 'https://s3-eu-west-1.amazonaws.com/somebucket/uploads/tmp/b011.dump' DATABASE
instead. I think in the new stuff ID may be preferred to URL, but URL ought to work as long as that URL is accessible. Hope that helps, otherwise let me know and we can try some other stuff.
这篇关于无法从转储导入到heroku postgres数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!