Restore a mongodb in meteor production server

前端 未结 2 2068
鱼传尺愫
鱼传尺愫 2020-12-30 17:03

I\'m trying to copy all the data from my localhost default meteor mongo database to the production server to use it in \"app.meteor.com\".

I tried to use mongorestor

2条回答
  •  佛祖请我去吃肉
    2020-12-30 17:29

    Run ~/meteor/meteor mongo -U yoapp

    You will get something like this

    mongodb://client:387shff-fe52-07d4-69a4-ba321f3665fe7@c0.meteor.m0.mongolayer.com:27017/yoapp_meteor_com
    

    Take the values and put into mongorestore like this

    mongorestore -u client -p 387shff-fe52-07d4-69a4-ba321f3665fe7 -h c0.meteor.m0.mongolayer.com:27017 -db yoapp_meteor_com /home/user/dump/yoapp
    

    I just dumped a prod app to my local dev machine. Testing some new changes. Pushed code to a staging install on meteor.com and then used mongorestore to populate the staging database.

提交回复
热议问题