3

We have a 3 member replica set mongodb running on mLab for a production website. We want to move the database to a new replica set hosted in our own Google Cloud account.

My current idea is to do the following steps

  1. use dump/restore to copy a snapshot of the current database to the new replica set on Google Cloud

  2. use oplog to keep the new replica set in sync with the current database

  3. stop writing to current database and switch endpoint to the new new replica set

The production website can still be accessible during step 1 and 2. And I can do step 3 at my choice of time to reduce down time.

I don't have much mongo DBA experience so looking for suggestions on

  1. Is the plan above making sense?
  2. What commands/tools should I look into to make my plan work?

Thanks in advance!

tjlian666
  • 343
  • 5
  • 17
  • 1
    What about adding new rd as replicas of the old one, then force elections to elect primary on google cloud and stop old replicas – matthPen Feb 19 '19 at 01:39
  • @matthPen Nice idea. Does it mean I will have nearly zero downtime? Like for apps that hit the old host:port, do they get to know the current primary is the one on google cloud and thus connect to the GC instance for read/write? – tjlian666 Feb 19 '19 at 22:26

0 Answers0