Skip to content

Commit 74cbe91

Browse files
committed
DOCS-8329 3.4 downgrade
1 parent d0c4ad7 commit 74cbe91

15 files changed

+825
-11
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Once upgraded to 3.4, you cannot downgrade to a 3.2.7 or earlier
2+
version. You can only downgrade to a 3.2.8 or later version.

source/includes/3.4-upgrade-enable-features.rst

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@ At this point, you can run the |newversion| binaries without the
22
|newversion| :ref:`features that are incompatible
33
<3.4-compatibility-enabled>` with |oldversion|.
44

5-
To complete the upgrade and enable these |newversion| features, you must set the
6-
feature compatibility version to |newversion|.
5+
To enable these |newversion| features, set the feature compatibility
6+
version to |newversion|.
77

8-
.. important::
9-
Enabling these backwards-incompatible features can complicate the
10-
downgrade process. Only enable these features when you are confident
11-
that the likelihood of downgrade is minimal.
8+
.. warning::
9+
10+
Enabling these backwards-incompatible features can :ref:`complicate
11+
the downgrade process <3.4-downgrade-features-prereq>`. For details,
12+
see :ref:`3.4-downgrade-features-prereq`.
13+
14+
It is recommended that after upgrading, you allow your deployment to
15+
run without enabling these features for a burn-in period to ensure
16+
the likelihood of downgrade is minimal. When you are confident that
17+
the likelihood of downgrade is minimal, enable these features.
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
ref: 3.4-downgrade-feature-compatibility
2+
content: |
3+
4+
Downgrade the ``featureCompatibilityVersion`` to ``"3.2"``.
5+
6+
.. code-block:: javascript
7+
8+
db.adminCommand({setFeatureCompatibilityVersion: "3.2"})
9+
10+
This command must perform writes to an internal system collection.
11+
If for any reason the command does not complete successfully, you
12+
can safely retry the command on the |target| as the operation is
13+
idempotent.
14+
---
15+
ref: 3.4-downgrade-views
16+
content: |
17+
18+
To find views, you can run the following in the :program:`mongo` shell:
19+
20+
.. code-block:: javascript
21+
22+
db.adminCommand("listDatabases").databases.forEach(function(d){
23+
let mdb = db.getSiblingDB(d.name);
24+
mdb.getCollectionInfos({type: "view"}).forEach(function(c){
25+
print(mdb[c.name]);
26+
});
27+
});
28+
29+
In each database that contains views, drop the ``system.views``
30+
collection to drop all views in that database.
31+
32+
---
33+
ref: 3.4-downgrade-collation-collections
34+
content: |
35+
36+
To find collections with collation specifications, you can run the
37+
following in the :program:`mongo` shell:
38+
39+
.. code-block:: javascript
40+
41+
db.adminCommand("listDatabases").databases.forEach(function(d){
42+
let mdb = db.getSiblingDB(d.name);
43+
mdb.getCollectionInfos( { "options.collation": { $exists: true } } ).forEach(function(c){
44+
print(mdb[c.name]);
45+
});
46+
});
47+
48+
You can migrate the content of the collection to a new collection
49+
without the collation specification (one way is via the
50+
aggregation pipeline stage :pipeline:`$out`).
51+
---
52+
ref: 3.4-downgrade-collation-indexes
53+
content: |
54+
55+
To find indexes with collation specification, you can run the
56+
following in the :program:`mongo` shell:
57+
58+
.. code-block:: javascript
59+
60+
db.adminCommand("listDatabases").databases.forEach(function(d){
61+
let mdb = db.getSiblingDB(d.name);
62+
mdb.getCollectionInfos().forEach(function(c){
63+
let currentCollection = mdb.getCollection(c.name);
64+
currentCollection.getIndexes().forEach(function(i){
65+
if (i.collation){
66+
printjson(i);
67+
}
68+
});
69+
});
70+
});
71+
72+
Drop the indexes with a collation specification. After the downgrade,
73+
recreate the dropped indexes.
74+
---
75+
ref: 3.4-downgrade-v2-indexes
76+
content: |
77+
78+
To find indexes with ``v: 2``, you can run the following in the
79+
:program:`mongo` shell:
80+
81+
.. code-block:: javascript
82+
83+
db.adminCommand("listDatabases").databases.forEach(function(d){
84+
let mdb = db.getSiblingDB(d.name);
85+
mdb.getCollectionInfos().forEach(function(c){
86+
let currentCollection = mdb.getCollection(c.name);
87+
currentCollection.getIndexes().forEach(function(i){
88+
if (i.v === 2){
89+
printjson(i);
90+
}
91+
});
92+
});
93+
});
94+
95+
---
96+
ref: 3.4-downgrade-decimal
97+
content: |
98+
99+
Convert any data of :ref:`decimal <3.4-decimal>` type. In versions
100+
of MongoDB earlier than 3.4, operations against documents that
101+
contain :ref:`decimal <3.4-decimal>` type may fail. For some
102+
possible conversion options, see
103+
:doc:`/tutorial/model-monetary-data`.
104+
105+
To detect the presence of decimal, you can run
106+
:method:`db.collection.validate(true) <db.collection.validate()>`
107+
against the collections which may contain decimal data.
108+
109+
:method:`db.collection.validate(true) <db.collection.validate()>`
110+
reports on decimal data only when ``featureCompatibilityVersion`` is
111+
``"3.2"``.
112+
113+
...
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
title: "Download the latest 3.2 binaries."
2+
level: 4
3+
ref: 3.4-downgrade-binaries-mongod
4+
content: |
5+
6+
Using either a package manager or a manual download, get the latest
7+
release in the 3.2 series. If using a package manager, add a new
8+
repository for the 3.2 binaries, then perform the actual downgrade
9+
process.
10+
11+
.. include:: /includes/3.4-downgrade-path.rst
12+
---
13+
title: "Restart with the latest 3.2 ``mongod`` instance."
14+
level: 4
15+
ref: 3.4-downgrade-restart-instance
16+
content: |
17+
Shut down your :program:`mongod` instance. Replace the existing
18+
binary with the downloaded :program:`mongod` binary and restart.
19+
...
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
title: "Download the latest 3.2 binaries."
2+
level: 4
3+
ref: 3.4-downgrade-binaries-rs
4+
content: |
5+
Using either a package manager or a manual download, get the latest
6+
release in the 3.2 series. If using a package manager, add a new
7+
repository for the 3.2 binaries, then perform the actual downgrade
8+
process.
9+
10+
.. include:: /includes/3.4-downgrade-path.rst
11+
---
12+
title: "Downgrade secondary members of the replica set."
13+
level: 4
14+
ref: downgrade-secondaries
15+
content: |
16+
17+
Downgrade each :term:`secondary` member of the replica set, one at a
18+
time:
19+
20+
a. Shut down the :program:`mongod`. See :ref:`terminate-mongod-processes` for instructions on safely terminating :program:`mongod` processes.
21+
22+
#. Replace the 3.4 binary with the 3.2 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 :program:`mongo` shell.
27+
28+
---
29+
title: Step down the primary.
30+
level: 4
31+
ref: step-down-primary
32+
pre: |
33+
Use :method:`rs.stepDown()` in the :program:`mongo` shell to
34+
step down the :term:`primary` and force the normal :ref:`failover
35+
<replica-set-failover>` procedure.
36+
action:
37+
language: javascript
38+
code:
39+
rs.stepDown()
40+
post: |
41+
:method:`rs.stepDown()` expedites the failover procedure and is
42+
preferable to shutting down the primary directly.
43+
---
44+
title: "Replace and restart former primary ``mongod``."
45+
level: 4
46+
ref: downgrade-primary
47+
content: |
48+
When :method:`rs.status()` shows that the primary has stepped down
49+
and another member has assumed ``PRIMARY`` state, shut down the
50+
previous primary and replace the :program:`mongod` binary with
51+
the 3.2 binary and start the new instance.
52+
...

0 commit comments

Comments
 (0)