This procedure assumes your current primary is
m1.example.net and that you’d like to instead make m3.example.net primary.
The procedure also assumes you have a three-member replica set with the
configuration below. For more information on configurations, see Replica Set
Configuration Use.

m3.example.net and m2.example.net sync with
m1.example.net (typically within 10 seconds).

m1.example.net sees that it no longer has highest priority and,
in most cases, steps down. m1.example.netdoes not step down
if m3.example.net’s sync is far behind. In that case,
m1.example.net waits until m3.example.net is within 10
seconds of its optime and then steps down. This minimizes the
amount of time with no primary following failover.

The step down forces on election in which m3.example.net
becomes primary based on its priority setting.

Optionally, if m3.example.net is more than 10 seconds behind
m1.example.net’s optime, and if you don’t need to have a primary
designated within 10 seconds, you can force m1.example.net to
step down by running:

This prevents m1.example.net from being primary for 86,400
seconds (24 hours), even if there is no other member that can become primary.
When m3.example.net catches up with m1.example.net it will
become primary.

If you later want to make m1.example.net
primary again while it waits for m3.example.net to catch up,
issue the following command to make m1.example.net seek election
again: