我想將我的本地PostgreSQL數據庫複製到Heroku應用程序pg_dump
/pg_restore
utils。根據Heroku的官方指南做:https://devcenter.heroku.com/articles/heroku-postgres-import-export在Heroku上不能讀pg_restore:「無法從輸入文件讀取:文件結尾」
所以,我已經做了轉儲:
pg_dump -Fc --no-acl --no-owner -h localhost -U myuser mydb > mydb.dump
然後我上傳它可達整個網絡服務器(和它的真正到達,我檢查它下載與wget
和pg_restore
文件 - 工作正常)。
然後我試圖恢復在Heroku和沒有運氣:
[email protected]:~/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.
下面是詳細信息:
[email protected]:~/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上進行恢復?
謝謝你的任何建議。
這種解決方案可能是相關的一些人:http://stackoverflow.com/questions/42433414/heroku-database-restore-issue/42435490#42435490 –