简体   繁体   English

如何通过heroku-valkyrie将“ db:transfer”用作heroku命令?

[英]How to use “db:transfer” as a heroku command by heroku-valkyrie?

I tried to use heroku-valkyrie to transfer my local data to heroku databse. 我试图使用heroku-valkyrie将本地数据传输到heroku数据库。 https://github.com/ddollar/heroku-valkyrie https://github.com/ddollar/heroku-valkyrie

I installed the plugin: 我安装了插件:

heroku plugins:install http://github.com/ddollar/heroku-valkyrie.git
Installing heroku-valkyrie... done

and wanted to transfer data: 并希望传输数据:

heroku db:transfer sqlite://db/development.sqlite3 postgres://my-apps-database-url/

but received this error message: 但收到以下错误消息:

 !    `db:transfer` is not a heroku command.
 !    See `heroku help` for a list of available commands.

How can I use db:transfer as a heroku command? 如何将db:transfer用作heroku命令?

According to Heroku documentation, you will have to export your local database as a dump file by using the pg dump tool and import the file using command., 根据Heroku文档,您将必须使用pg dump工具将本地数据库导出为转储文件,并使用command导入该文件。

heroku pgbackups:restore DATABASE ' https://s3.amazonaws.com/me/items/3H0q/mydb.dump ' heroku pgbackups:恢复数据库' https://s3.amazonaws.com/me/items/3H0q/mydb.dump '

Check for complete documentation here 在此处检查完整的文档

Try running heroku plugins:install https://github.com/ddollar/heroku-pg-transfer first. 尝试运行heroku plugins:install https://github.com/ddollar/heroku-pg-transfer首先heroku plugins:install https://github.com/ddollar/heroku-pg-transfer

Then the command will be pg:transfer , not db:transfer . 然后,该命令将为pg:transfer ,而不是db:transfer

However, you may run into issues since you're transferring from an sqlite database and this command only transfers from postgre. 但是,由于要从sqlite数据库进行传输,因此此命令可能仅会从postgre进行传输,因此可能会遇到问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM