Migration of Replica set to new datacenter

Welcome to the MongoDB Community @Kamal_Mahana!

I expect you may have completed your migration by now, but here is a suggestion if you are still in the planning stage (or perhaps someone else has a similar question).

You can migrate your replica set from the original data centre (DC1) to a new data centre (DC2) without downtime by temporarily adding more members to your replica set.

As general steps I would:

  • Add members in DC2 using initial sync or a file copy backup.

  • Configure additional members in DC2 as hidden, priority 0 until you are ready to start sending application traffic to the new data centre.

  • When ready to switch over, reconfigure the new members in DC2 as electable and hide the original members in DC1.

  • Remove the hidden members in DC1 to finalise your migration.

I also recommend taking this opportunity to replace your arbiter with a full data-bearing secondary. Arbiters are not ideal (see my comment on Replica set with 3 DB Nodes and 1 Arbiter - #8 by Stennie) and the operational consequences will be more disruptive with an active cluster.

Regards,
Stennie