问题描述
我有一个共享的heroku应用程序,现在我无法创建一个测试应用程序也在heroku与相同的代码,所以我已经创建了一个新的应用程序,确定,事情是为应用程序的工作需要一个数据库,所以我试图上传我的本地数据库,但不知道如何。
任何人都可以告诉我在我的命令行中需要输入什么
感谢
Ps:应用程序使用Django
您应该从网址中恢复数据库,请参阅:
heroku pgbackups:restore DATABASE 'http://f.cl.l...3z18/mydb.dump'
Edit:
pgbackups
addon已经。该过程现在内置到CLI工具中。有关详情,请。新方法如下所示:
heroku pg:backups restore'http://f.cl.l...3z18 /mydb.dump'DATABASE
I have a shared heroku app, now I wan't to create a test app also in heroku with the same code, so I've created a new app, ok, the thing is that for the app to work it needs a database, so I'm trying to upload my local DB but don't know how to.
Can anyone tell me what do I have to type in my command line so I can get my local DB uploaded?
Thanks
Ps: The app uses Django
You should restore database from a url, see heroku import doc:
heroku pgbackups:restore DATABASE 'http://f.cl.l...3z18/mydb.dump'
Edit:
The pgbackups
addon has been deprecated. The process is now built in to the CLI tools. More details here. The new method looks like this:
heroku pg:backups restore 'http://f.cl.l...3z18/mydb.dump' DATABASE
这篇关于如何将数据库上传到Heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!