我正在尝试使用pg_dump / pg_restore utils将我的本地Postgresql数据库复制到Heroku应用程序.根据Heroku的官方指南做:
https://devcenter.heroku.com/articles/heroku-postgres-import-export
所以,我做了转储:
pg_dump -Fc –no-acl –no-owner -h localhost -U myuser mydb> mydb.dump
然后我把它上传到可以通过网络服务器访问(它真的可以访问,我已经检查过它用wget和pg_restoreing下载文件 – 工作正常).
然后我试图恢复Heroku而没有运气:
kulver@kvb:~/projects/gop/gop_flask$heroku pg:backups restore 'MY_URL_HERE' postgresql-corrugated-15763 r010 ---restore---> DATABASE An error occurred and your backup did not finish. Please run `heroku pg:backups info r010` for details.
以下是详细信息:
kulver@kvb:~/projects/gop/gop_flask$heroku pg:backups info r010 === Backup info: r010 Database: BACKUP Started: 2016-03-26 20:15:32 +0000 Finished: 2016-03-26 20:15:32 +0000 Status: Failed Type: Manual Backup Size: 23.9MB === Backup Logs ... a bunch of logs here ... 2016-03-26 20:15:32 +0000: pg_restore: processing data for table "cards" 2016-03-26 20:15:32 +0000: waiting for restore to complete 2016-03-26 20:15:32 +0000: pg_restore: [custom archiver] could not read from input file: end of file 2016-03-26 20:15:32 +0000: restore done 2016-03-26 20:15:32 +0000: waiting for download to complete 2016-03-26 20:15:32 +0000: download done
我试图重制转储文件,重新加载它 – 同样的错误.怎么了?为什么我可以在刚刚创建的数据库上下载并从中恢复,但不能在Heroku上恢复?
谢谢你的任何建议.