0

I am taking Mongo DB Dump from a production server where we have some limitation on file size which can be transferred from production to local environment.

So we are planning to 1)Take Mongo DB Dump in production 2)Decompose that huge dump into multiple pieces 3)Shift all the pieces to local setup 4)Then re-join all the pieces

Need suggestions - if this process will work fine or there are other ways of doing this activity Please support with relevant commands in linux.

Thanks

1 Answer 1

1

There is no need to save the dump into a file. You can pipe the output directly into import tool, for example like this:

mongodump --uri="mongodb://production-server:27017" --db=some_database --collection=some_collection --archive=- | mongorestore --uri="mongodb://local-server:27017" --nsFrom="some_database.some_collection" --nsTo="some_or_other_database.some_or_other_collection" --archive=-

You can do the same with mongoexport ... | mongoimport ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.