RedHat and CentOS - Process for Upgrading MongoDB 4.2 Standalone to MongoDB6.0 Standalone
CentOS Linux 7.9. Process for Upgrading MongoDB 4.2 Standalone to MongoDB 6.0 Standalone.
MongoDB upgrade requires that you must upgrade to each version of MongoDB along the way.
This document will follow the MongoDB upgrade path from 4.2 → 4.4 → 5.0 → 6.0, with the document structured as follows:
Prerequisites
Upgrade Preparation
Upgrade from MongoDB 4.2 to MongoDB 4.4
Upgrade from MongoDB 4.4 to MongoDB 5.0
Upgrade from MongoDB 5.0 to MongoDB 6.0
Services Restart
1.- Prerequisites.
his document outlines the process to bring MongoDB up to version 6.0. There are a series of prerequisites that determine the type of update required. This document outlines the process for MongoDB Standalone.
There are 4 prerequisites to confirm:
Operating System
MongoDB Version
MongoDB Storage Engine
NMIS and Modules for Mongo 6.0
Operating System.
We have tested the upgrade process from MongoDB 4.2 to MongoDB 6.0 on:
[root@centosmongo6 ~]# more /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
MongoDB version.
[root@centosmongo6 ~]# mongod --version
db version v4.2.25
git version: 41b59c2bfb5121e66f18cc3ef40055a1b5fb6c2e
OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
allocator: tcmalloc
modules: none
build environment:
distmod: rhel70
distarch: x86_64
target_arch: x86_64
[root@centosmongo6 ~]#
[root@centosmongo6 ~]# mongo -u opUserRW -p op42flow42 --authenticationDatabase=admin --eval 'quit()' | grep MongoDB
MongoDB shell version v4.2.25
MongoDB server version: 4.2.25
MongoDB storage engine.
The "name" line should have "wiredTiger" in order to proceed.
NMIS and Modules for Mongo 6.
NMIS and Modules must be updated to versions that support MongoDB 6.0 before upgrading to MongoDB 6.0. These releases are backwards compatible with MongoDB v4.2 which means that you can upgrade to NMIS and Modules that support MongoDB 6.0, restart NMIS and Modules, and continue to use them with MongoDB 4.2, then upgrade your MongoDB from 4.2 to 6.0 later.
Minimum releases that support MongoDB 6.0 are:
NMIS 9.5.0
opAddress 2.4.0
opCharts 4.8.0
opConfig 4.6.0
opEvents 4.4.0
opHA 4.1.0
opReports 4.6.0
opFlow 4.1.0
You can determine the versions you are running by browsing to:
https://<yourserveraddress>/omk/
You should follow the standard upgrade process for each of these packages, which is handled by the FirstWave Installer.
2.- Upgrade Preparation.
The preparation phase includes 3 sections
System Snapshot/Backup
Upgrade Linux to latest stable release packages
Shutdown all OMK Daemons
This is to be done in this specific sequence.
System Snapshot/Backup
For System Snapshots and Backups you will need to refer to the documentation for your environment.
If the information on your system, or stability of the system is critical to your business it is important to retain a working backup. It is important that you have confirmed that your backups can be restored.
Options:
Full system backups, including Operating System and Data - Contact your IT department, Vendor Support, or Integrator
Virtual Machine Snapshots - Refer to the solution guides for the environment
Database Dump - MongoDB documentation: https://www.mongodb.com/docs/database-tools/mongodump/
Upgrade Linux Packages.
After completing the snapshot/backup follow Centos instructions for upgrading and checking the sanity of the system.
An example of the update/upgrade cycle is as follows:
Shutdown All FirstWave Daemons
Prior to commencing into the MongoDB upgrade cycles it is required to shutdown all FirstWave processes. The following commands are used to complete this task
Confirm that the daemons have stopped.
Upgrade from MongoDB 4.2 to MongoDB 4.4
Check the database compatibility mode is set to "4.2". The result should be as follows ensuring that the value 4.2 is set.
Deleted the old mongoDB repo.
Create a new repo file.
Please insert this:
Install mongoDB
Example output:
Restart mongoDB daemon.
Example output:
Check the mongoDB version
Change and Check the mongoDB compatibility mode.
To change the mongoDB compatibility mode, please use this command. It must be 4.4
Example output:
Upgrade from MongoDB 4.4 to MongoDB 5.0
Check the database compatibility mode is set to "4.4". The result should be as follows ensuring that the value 4.4 is set.
Deleted the old mongoDB repo.
Create a new repo file.
Please insert this:
Install mongoDB
Example output:
Restart mongoDB daemon.
Example output:
Check the mongoDB version
Change and Check the mongoDB compatibility mode.
To change the mongoDB compatibility mode, please use this command. It must be 5.0
Example output:
Upgrade from MongoDB 5.0 to MongoDB 6.0
Check the database compatibility mode is set to "5.0". The result should be as follows ensuring that the value 5.0 is set.
Deleted the old mongoDB repo.
Create a new repo file.
Please insert this:
Install mongoDB
Example output:
Restart mongoDB daemon.
Example Output:
Check the mongoDB version
Change and Check the mongoDB compatibility mode.
Example Output:
To change the mongoDB compatibility mode, please use this command. It must be 6.0
Example Output:
Restart the mongoDB daemon.
Services Restart
Now the MongoDB upgrade is complete, you can start all the NMIS and FirstWave daemons.
The following commands are used to complete this task
You can now browse to your FirstWave instance with:
https://<yourserver>/omk
You will get a screen similar to the following which will give you a status on all installed modules: