无法将postgres数据库附加到Heroku应用程序

时间:2018-03-12 08:51:35

标签: django database postgresql heroku

我有一个带PostgresQL数据库的Django应用程序。我已经成功地在heroku(myapp)上部署了应用程序,但是在将本地数据库附加到它时遇到了麻烦。

要将本地数据库附加到我的Heroku应用程序(myapp),我按照以下步骤进行操作

1.Created database(db-name)转储文件

sudo pg_dump -U postgres db-name > db-name.dump

2.在线上载转储文件,可通过链接访问

https:url/db-name.dump

按照上面的链接下载db-name.dump文件

3.使用pg:backups:restore命令恢复我的heroku应用程序上的备份

heroku pg:backups:restore 'https:url/db-name.dump' DATABASE_URL --confirm myapp

发出上述pg:backups:restore命令后,我收到错误

Restoring... !
 ▸    An error occurred and the backup did not finish.
 ▸    
 ▸    waiting for restore to complete
 ▸    pg_restore: [archiver] did not find magic string in file header
 ▸    pg_restore finished with errors
 ▸    waiting for download to complete
 ▸    download finished successfully
 ▸    
 ▸    Run heroku pg:backups:info r004 for more details.

有人猜到了这里发生了什么......

0 个答案:

没有答案
相关问题