0

How to perform mongo DB dump and restore in a single command, by providing source and sink DB and collection name separately?

I understand we can do mongodump and then mongorestore but if I need to this on an intermediate machine, this will mean I will need to wait for mongodump to complete before I can start mongorestore manually again. Is there a way to do it in a single command?

New contributor
Shubham A. is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1

You mean like this: mongodump --archive --db=test --port=27017 | mongorestore --archive --port=27018

| improve this answer | |

Your Answer

Shubham A. is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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