Clone mongoDB collections

142 Views Asked by At

I have different servers with mongoDB in it. What is the best way to clone one collection from one server to another ? I did use mongodump (using Studio 3T) and create a BSON archive of the collection I want to copy on the another server. To do so I did log in as admin of the mongoDB server to copy and created the BSON archive. Then I did login in the other server as admin as well and tried to import the BSON archive but is always end up with : error reading database: not authorized on to execute command. I did add the admin credential of the first server on the second server as well and logged in with the same credentials. What would be the correct way to clone/duplicate a collection from one server to another ?

Thanks

1

There are 1 best solutions below

0
On

I was finally able to clone a db between two servers. Had to play with some user roles, granting roles before not assigned to the user from who created the system. So at least this is solved, now I'm working to actually be able to use the cloned db. Thanks