简体   繁体   中英

DB reset after deploy to meteor servers

I re-deployed my app to meteor by using ' meteor deploy '
and my Database was reset.
Any clue why this happened or how I can avoid it in the future ?

When a meteor app is deployed, your data saved in local mongo would not deployed to the server. So you could use mongodump and mongorestore to solve it:( docs )

Now first dump your database somewhere

mongodump --host localhost:3001

Get your mongodb`s credentials by running (in your app dir):

meteor mongo myapp.meteor.com --url

This will give you database url in the form:

mongodb:// username : password @ host : port / databasename

With these info you could fill them into mongorestore ( docs ) and restore your local database over

mongorestore -u username -p password -h host:port -d databasename ~/desktop/location_of_your_mongodb_dump

All of your data would get transferred in this way. I wish it could help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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