How to use the dumped data by mongodump?

前端 未结 6 2065
無奈伤痛
無奈伤痛 2020-12-04 15:03

I have used mongodump to dump my database of mongodb, it created some bson files under dump/mydb

But I don\'t know how to use them. I tried

6条回答
  •  悲&欢浪女
    2020-12-04 15:38

    You need to use mongorestore, not mongoimport ... which is used for things like importing json, or csv, etc.

    From the back-up-with-mongodump docs:

    mongodump reads data from a MongoDB database and creates high fidelity BSON files which the mongorestore tool can use to populate a MongoDB database.

    mongodump and mongorestore are simple and efficient tools for backing up and restoring small MongoDB deployments, but are not ideal for capturing backups of larger systems.

    You can read more about mongorestore in the docs below; I'd take a look and read up on them as they are very helpful.

    http://www.mongodb.org/display/DOCS/Import+Export+Tools#ImportExportTools-mongorestore

    You can also check out http://learnmongo.com for tips and help!

提交回复
热议问题