I have a collection with more than 1 TB size and wanted to move it another MongoDB cluster
PS: Both clusters are sharded over 5 shards and they are on-prem infra.
I have a collection with more than 1 TB size and wanted to move it another MongoDB cluster
PS: Both clusters are sharded over 5 shards and they are on-prem infra.
As per MongoDB documentation here through the db.cloneCollection(from, collection, query) it's Copies data directly between MongoDB instances.
use users
db.cloneCollection('mongodb.example.net:27017', 'profiles',
{ 'active' : true } )
This operation copies the profiles collection from the users database on the server at mongodb.example.net into the users database on the local server. The operation only copies documents that satisfy the query { 'active' : true }.