MongoDB DR setup on a different network

I have production setup having two nodes(Primary and Secondary). I have a requirement to migrate it to new data center(Different network). Can someone help with the steps if this can be achieved?

Thanks in advance.

I also have this question, can anyone help?

If the 2 data centres can talk together you could achieve that without downtime with:

  1. start by starting nodes in the new centre and add them to the replica set.
  2. when all data are synced to the new centre, simply terminate the nodes from the original center

You replica set should have at least three nodes. With two nodes your database is not writable if you lose one.

2 Likes