> Thanks for your reply. So what I understand was MongoExport will export
> one collection(from one database) at a time. Is it right stephen..??????
Yes, mongoexport is for exporting one collection to a text format (CSV,
So if we want to export all the databases we need to use "MONGO DUMP"
If you want to backup and restore all of the collections and databases,
mongodump/mongorestore are the correct programs to use.
If you want to export each collection to a text format, you can use
mongoexport but you will have to call it once for every collection.
So if we export one collection at a time when this *--directoryperdb* come
> into picture. I didn't understand clearly. Could you please explain with
> one example please.
You would only want to use this option if all of the following are true:
- you are using --directoryperdb in your mongod configuration
- you want to use --dbpath from mongoexport/mongodump (which reads the
data files directly instead of connecting to the mongo server)
- you do not have a mongod currently using those db files
This is very likely *not* an option you want to use, which is why I
suggested you should not include it.