Skip to content

Commit 6a7de34

Browse files
committed
DOCSP-16235 prepare v5.0 upgrade downgrade guides
1 parent 1b97357 commit 6a7de34

19 files changed

+1564
-3
lines changed

config/redirects

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,4 +1797,36 @@ raw: /manual/core/wildcard -> ${base}/manual/core/index-wildcard/
17971797
[v5.0-*]: /${version}/reference/method/db.getProfilingLevel -> ${base}/${version}/reference/method/db.getProfilingStatus
17981798
[v5.0-*]: /${version}/mongo -> ${base}/${version}/reference/mongo
17991799

1800+
#
1801+
# Upgrade / Downgrade redirects
1802+
#
18001803

1804+
[v3.6-v4.2]: /${version}/release-notes/4.4-upgrade-standalone -> ${base}/${version}/release-notes
1805+
[v3.6-v4.2]: /${version}/release-notes/4.4-upgrade-replica-set -> ${base}/${version}/release-notes
1806+
[v3.6-v4.2]: /${version}/release-notes/4.4-upgrade-sharded-cluster -> ${base}/${version}/release-notes
1807+
[v3.6-v4.2]: /${version}/release-notes/4.4-downgrade-standalone -> ${base}/${version}/release-notes
1808+
[v3.6-v4.2]: /${version}/release-notes/4.4-downgrade-replica-set -> ${base}/${version}/release-notes
1809+
[v3.6-v4.2]: /${version}/release-notes/4.4-downgrade-sharded-cluster -> ${base}/${version}/release-notes
1810+
1811+
[v3.6-v4.4]: /${version}/release-notes/5.0-upgrade-standalone -> ${base}/${version}/release-notes
1812+
[v3.6-v4.4]: /${version}/release-notes/5.0-upgrade-replica-set -> ${base}/${version}/release-notes
1813+
[v3.6-v4.4]: /${version}/release-notes/5.0-upgrade-sharded-cluster -> ${base}/${version}/release-notes
1814+
1815+
[v3.6-v4.4]: /${version}/release-notes/5.0-downgrade-standalone -> ${base}/${version}/release-notes
1816+
[v3.6-v4.4]: /${version}/release-notes/5.0-downgrade-replica-set -> ${base}/${version}/release-notes
1817+
[v3.6-v4.4]: /${version}/release-notes/5.0-downgrade-sharded-cluster -> ${base}/${version}/release-notes
1818+
1819+
[v4.4]: /${version}/release-notes/5.0-upgrade-standalone -> ${base}/${version}/release-notes/4.4-upgrade-standalone
1820+
[v4.2]: /${version}/release-notes/5.0-upgrade-standalone -> ${base}/${version}/release-notes/4.2-upgrade-standalone
1821+
[v4.0]: /${version}/release-notes/5.0-upgrade-standalone -> ${base}/${version}/release-notes/4.0-upgrade-standalone
1822+
[v3.6]: /${version}/release-notes/5.0-upgrade-standalone -> ${base}/${version}/release-notes/3.6-upgrade-standalone
1823+
1824+
[v4.4]: /${version}/release-notes/5.0-upgrade-replica-set -> ${base}/${version}/release-notes/4.4-upgrade-replica-set
1825+
[v4.2]: /${version}/release-notes/5.0-upgrade-replica-set -> ${base}/${version}/release-notes/4.2-upgrade-replica-set
1826+
[v4.0]: /${version}/release-notes/5.0-upgrade-replica-set -> ${base}/${version}/release-notes/4.0-upgrade-replica-set
1827+
[v3.6]: /${version}/release-notes/5.0-upgrade-replica-set -> ${base}/${version}/release-notes/3.6-upgrade-replica-set
1828+
1829+
[v4.4]: /${version}/release-notes/5.0-upgrade-sharded-cluster -> ${base}/${version}/release-notes/4.4-upgrade-sharded-cluster
1830+
[v4.2]: /${version}/release-notes/5.0-upgrade-sharded-cluster -> ${base}/${version}/release-notes/4.2-upgrade-sharded-cluster
1831+
[v4.0]: /${version}/release-notes/5.0-upgrade-sharded-cluster -> ${base}/${version}/release-notes/4.0-upgrade-sharded-cluster
1832+
[v3.6]: /${version}/release-notes/5.0-upgrade-sharded-cluster -> ${base}/${version}/release-notes/3.6-upgrade-sharded-cluster

source/includes/5.0-downgrade-fcv.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Downgrade the ``featureCompatibilityVersion`` to |oldfcv|.
2+
3+
.. code-block:: javascript
4+
5+
db.adminCommand({setFeatureCompatibilityVersion: "4.4"})
6+
7+
The :dbcommand:`setFeatureCompatibilityVersion` command performs writes
8+
to an internal system collection and is idempotent. If for any reason
9+
the command does not complete successfully, retry the command on the
10+
|target|.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.. |newversion| replace:: 5.0
2+
.. |newseries| replace:: 5.0-series
3+
.. |oldversion| replace:: 4.4
4+
.. |oldseries| replace:: 4.4-series
5+
.. |olderseries| replace:: 4.2-series
6+
.. |compatibility| replace:: :doc:`/release-notes/5.0-compatibility`
7+
.. |upgradefirst| replace:: :ref:`upgrade first to 4.4 <4.4-upgrade>`
8+
.. |downgradepath| replace:: Once upgraded to |newversion|, if you need to downgrade, we recommend |downgrading| to the latest patch release of |downgradeversion|.
9+
10+
.. |features| replace:: :ref:`features<5.0-compatibility-enabled>`
11+
.. |downgradeversion| replace:: 4.4
12+
13+
.. |installationdoc| replace:: :doc:`5.0 installation instructions </installation>`
14+
15+
.. |newfcv| replace:: ``"5.0"``
16+
.. |oldfcv| replace:: ``"4.4"``

source/includes/extracts-enterprise.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ content: |
1919
2020
Do not use these instructions to upgrade to another release version.
2121
To upgrade release versions, refer to the appropriate release
22-
upgrade instructions, such as :ref:`Upgrade to MongoDB 4.2
23-
<4.2-upgrade>`.
22+
upgrade instructions, such as :ref:`Upgrade to MongoDB 5.0
23+
<5.0-upgrade>`.
2424
---
2525
ref: enterprise-install-binaries
2626
content: |
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
title: "Download the latest |oldversion| binaries."
2+
level: 4
3+
ref: 5.0-downgrade-binaries-mongod
4+
content: |
5+
6+
Using either a package manager or a manual download, get the latest
7+
release in the |oldversion| series. If using a package manager, add a new
8+
repository for the |oldversion| binaries, then perform the actual downgrade
9+
process.
10+
11+
.. include:: /includes/downgrade-path.rst
12+
---
13+
title: "Shut down the ``mongod`` instance."
14+
level: 4
15+
ref: 5.0-downgrade-shutdown-instance
16+
content: |
17+
18+
To cleanly shut down the :binary:`~bin.mongod` process, connect a
19+
:binary:`~bin.mongo` shell to the instance and run:
20+
21+
.. code-block:: javascript
22+
23+
db.adminCommand( { shutdown: 1 } )
24+
25+
A :ref:`clean shutdown <terminate-mongod-processes>` of a
26+
:binary:`~bin.mongod` completes all pending operations,
27+
flushes all data to data files, and closes all data files.
28+
---
29+
title: "Restart with the latest |oldversion| ``mongod`` instance."
30+
level: 4
31+
ref: 5.0-downgrade-restart-instance
32+
content: |
33+
34+
Replace the |newversion| binary with the downloaded |oldversion|
35+
:binary:`~bin.mongod` binary and restart.
36+
37+
...
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
title: "Download the latest |oldversion| binaries."
2+
level: 4
3+
ref: 5.0-downgrade-binaries-rs
4+
content: |
5+
Using either a package manager or a manual download, get the latest
6+
release in the |oldversion| series. If using a package manager, add a new
7+
repository for the |oldversion| binaries, then perform the actual downgrade
8+
process.
9+
10+
.. include:: /includes/downgrade-path.rst
11+
---
12+
title: "Downgrade secondary members of the replica set."
13+
level: 4
14+
ref: 5.0-downgrade-secondaries
15+
content: |
16+
17+
Downgrade each :term:`secondary` member of the replica set, one at a
18+
time:
19+
20+
a. .. include:: /includes/4.4-downgrade-clean-shutdown.rst
21+
22+
#. Replace the |newversion| binary with the |oldversion| binary and restart.
23+
24+
#. Wait for the member to recover to ``SECONDARY`` state
25+
before downgrading the next secondary. To check the member's state,
26+
use the :method:`rs.status()` method in the :binary:`~bin.mongo` shell.
27+
28+
#. Once the member is in ``SECONDARY`` stage, downgrade the next
29+
secondary.
30+
---
31+
title: "Downgrade arbiter replica set member, if any."
32+
level: 4
33+
ref: 5.0-downgrade-arbiters
34+
content: |
35+
36+
Skip this step if the replica set does not include an arbiter.
37+
38+
Downgrade the :ref:`arbiter <replica-set-arbiter-configuration>` member of
39+
the replica set:
40+
41+
a. .. include:: /includes/4.4-downgrade-clean-shutdown.rst
42+
43+
#. Delete the contents of the arbiter data directory. The
44+
:setting:`storage.dbPath` configuration setting or
45+
:option:`--dbpath <mongod --dbpath>` command line option specify the
46+
data directory of the arbiter :binary:`~bin.mongod`.
47+
48+
.. code-block:: bash
49+
50+
rm -rf /path/to/mongodb/datafiles/*
51+
52+
#. Replace the |newversion| binary with the |oldversion| binary and restart.
53+
54+
#. Wait for the member to recover to ``ARBITER`` state. To check
55+
the member's state, connect a :binary:`~bin.mongo` shell to the
56+
member and run :method:`rs.status()` method.
57+
---
58+
title: Step down the primary.
59+
level: 4
60+
ref: 5.0-step-down-primary
61+
pre: |
62+
Use :method:`rs.stepDown()` in the :binary:`~bin.mongo` shell to
63+
step down the :term:`primary` and force the normal :ref:`failover
64+
<replica-set-failover>` procedure.
65+
action:
66+
language: javascript
67+
code:
68+
rs.stepDown()
69+
post: |
70+
:method:`rs.stepDown()` expedites the failover procedure and is
71+
preferable to shutting down the primary directly.
72+
---
73+
title: "Replace and restart former primary ``mongod``."
74+
level: 4
75+
ref: 5.0-downgrade-primary
76+
content: |
77+
When :method:`rs.status()` shows that the primary has stepped down
78+
and another member has assumed ``PRIMARY`` state:
79+
80+
a. .. include:: /includes/4.4-downgrade-clean-shutdown.rst
81+
82+
b. Replace the :binary:`~bin.mongod` binary with
83+
the |oldversion| binary and restart.
84+
85+
...
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
title: "Download the latest |oldversion| binaries."
2+
level: 4
3+
ref: 5.0-downgrade-binaries-sharded-cluster
4+
content: |
5+
Using either a package manager or a manual download, get the latest
6+
release in the |oldversion| series. If using a package manager, add a new
7+
repository for the |oldversion| binaries, then perform the actual downgrade
8+
process.
9+
10+
.. include:: /includes/downgrade-path.rst
11+
---
12+
title: Disable the Balancer.
13+
level: 4
14+
ref: disable-balancer
15+
content: |
16+
Connect a :binary:`~bin.mongo` shell to a :binary:`~bin.mongos` instance in
17+
the sharded cluster, and run :method:`sh.stopBalancer()` to
18+
disable the balancer:
19+
20+
.. code-block:: javascript
21+
22+
sh.stopBalancer()
23+
24+
.. note::
25+
26+
If a migration is in progress, the system will complete the
27+
in-progress migration before stopping the balancer. You can run
28+
:method:`sh.isBalancerRunning()` to check the balancer's current
29+
state.
30+
31+
To verify that the balancer is disabled, run
32+
:method:`sh.getBalancerState()`, which returns false if the balancer
33+
is disabled:
34+
35+
.. code-block:: javascript
36+
37+
sh.getBalancerState()
38+
39+
For more information on disabling the balancer, see
40+
:ref:`sharding-balancing-disable-temporarily`.
41+
42+
---
43+
title: "Downgrade the ``mongos`` instances."
44+
level: 4
45+
ref: downgrade-mongos
46+
content: |
47+
Downgrade the binaries and restart.
48+
---
49+
title: Downgrade each shard, one at a time.
50+
level: 4
51+
ref: 5.0-downgrade-shard
52+
content: |
53+
54+
Downgrade the shards one at a time.
55+
56+
A. Downgrade the shard's :ref:`secondary <replica-set-secondary-members>`
57+
members one at a time:
58+
59+
1. .. include:: /includes/4.4-downgrade-clean-shutdown.rst
60+
61+
#. Replace the |newversion|
62+
binary with the |oldversion| binary and restart.
63+
64+
#. Wait for the member to recover to ``SECONDARY`` state before
65+
downgrading the next secondary member. To check
66+
the member's state, connect a :binary:`~bin.mongo` shell to the shard
67+
and run :method:`rs.status()` method.
68+
69+
Repeat to downgrade for each secondary member.
70+
71+
#. Downgrade the shard :ref:`arbiter <replica-set-arbiter-configuration>`, if any.
72+
73+
Skip this step if the replica set does not include an arbiter.
74+
75+
1. .. include:: /includes/4.4-downgrade-clean-shutdown.rst
76+
77+
#. Delete the contents of the arbiter data directory. The
78+
:setting:`storage.dbPath` configuration setting or
79+
:option:`--dbpath <mongod --dbpath>` command line option specify the
80+
data directory of the arbiter :binary:`~bin.mongod`.
81+
82+
.. code-block:: bash
83+
84+
rm -rf /path/to/mongodb/datafiles/*
85+
86+
#. Replace the |newversion| binary with the |oldversion| binary and restart.
87+
88+
#. Wait for the member to recover to ``ARBITER`` state. To check
89+
the member's state, connect a :binary:`~bin.mongo` shell to the
90+
member and run :method:`rs.status()` method.
91+
92+
#. Downgrade the shard's primary.
93+
94+
1. Step down the replica set primary. Connect a
95+
:binary:`~bin.mongo` shell to the primary and use
96+
:method:`rs.stepDown()` to step down the primary and force an
97+
election of a new primary:
98+
99+
.. code-block:: javascript
100+
101+
rs.stepDown()
102+
103+
#. Run :method:`rs.status()`.
104+
105+
.. code-block:: javascript
106+
107+
rs.status()
108+
109+
When the status shows that the primary has stepped down and
110+
another member has assumed ``PRIMARY`` state, proceed.
111+
112+
#. Run the following command from the :binary:`~bin.mongo` shell to
113+
perform a clean shutdown of the stepped-down primary, or refer to
114+
:ref:`terminate-mongod-processes` for additional ways to safely
115+
terminate the :binary:`~bin.mongod` process:
116+
117+
.. code-block:: javascript
118+
119+
db.adminCommand( { shutdown: 1 } )
120+
121+
#. Replace the |newversion|
122+
binary with the |oldversion| binary and restart.
123+
124+
Repeat for the remaining shards.
125+
---
126+
title: "Downgrade the config servers."
127+
level: 4
128+
ref: 5.0-downgrade-config-servers
129+
content: |-
130+
131+
A. Downgrade the :ref:`secondary <replica-set-secondary-members>`
132+
members of the config servers replica set (CSRS) one at a time:
133+
134+
1. .. include:: /includes/4.4-downgrade-clean-shutdown.rst
135+
136+
#. Replace the |newversion|
137+
binary with the |oldversion| binary and restart.
138+
139+
140+
#. Wait for the member to recover to ``SECONDARY`` state before
141+
downgrading the next secondary member. To check
142+
the member's state, connect a :binary:`~bin.mongo` shell to the shard
143+
and run :method:`rs.status()` method.
144+
145+
Repeat to downgrade for each secondary member.
146+
147+
#. Step down the config server primary.
148+
149+
1. Connect a :binary:`~bin.mongo` shell to the primary and use
150+
:method:`rs.stepDown()` to step down the primary and force an
151+
election of a new primary:
152+
153+
.. code-block:: javascript
154+
155+
rs.stepDown()
156+
157+
#. Run :method:`rs.status()`.
158+
159+
.. code-block:: javascript
160+
161+
rs.status()
162+
163+
When the status shows that the primary has stepped down and
164+
another member has assumed ``PRIMARY`` state, proceed.
165+
166+
#. Run the following command from the :binary:`~bin.mongo` shell to
167+
perform a clean shutdown of the stepped-down primary, or refer to
168+
:ref:`terminate-mongod-processes` for additional ways to safely
169+
terminate the :binary:`~bin.mongod` process:
170+
171+
.. code-block:: javascript
172+
173+
db.adminCommand( { shutdown: 1 } )
174+
175+
#. Replace the |newversion|
176+
binary with the |oldversion| binary and restart.
177+
178+
179+
---
180+
title: "Re-enable the balancer."
181+
level: 4
182+
ref: reenable-balancer
183+
content: |
184+
185+
Once the downgrade of sharded cluster components is complete, connect
186+
a :binary:`~bin.mongo` shell to a :binary:`~bin.mongos` and
187+
:ref:`re-enable the balancer <sharding-balancing-enable>`.
188+
189+
.. code-block:: javascript
190+
191+
sh.startBalancer()
192+
193+
The :binary:`~bin.mongo` shell method :method:`sh.startBalancer()`
194+
also enables auto-splitting for the sharded cluster.
195+
196+
...

0 commit comments

Comments
 (0)