Tag Archives: db.copy

MongoDB – How to Copy Database

Using copydb Run the copydb under admin database with from,to, host parameters >use admin switched to db admin > db.runCommand({ copydb: 1, fromdb: “test”, todb: “new_test”, fromhost: “localhost” }) Using copyDatabase method The db.copyDatabase() method is used to copy a … Continue reading

Posted in MongoDB | Tagged , , | Leave a comment