Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top