1

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.

Md Haidar Ali Khan
  • 6,523
  • 9
  • 40
  • 62
andy_l
  • 31
  • 1
  • 3

1 Answers1

0

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 }.

For further your ref here , here , here and here

Md Haidar Ali Khan
  • 6,523
  • 9
  • 40
  • 62