Upgrade MongoDB



Note: It is mandatory to install latest mongoDB (v4.2.8) from styx v6.58. To know more on Mongo DB upgrade, refer to MongoDB document: https://docs.mongodb.com/manual/release-notes/4.2-upgrade-standalone/#download-newversion-binaries.


Upgrade MongoDB version lower than 4.X

 

Note: If MongoDB version is lower than 4.x, we recommend to take backup and restore the existing version of MongoDB before upgrading to the 4.x version.


To upgrade MongoDB, follow these steps: 

1.  Take backup of On-premise MongoDB database. 

2.  At the Command prompt, run the following command and press Enter. 

 < mongodump --db mondodb_name > 

 Example: < mongodump --db suremdmdb >

3.  Uninstall older version of MongoDB and install the latest version 4.2.8.

4.  To restore MongoDB,run the following command:

     mongorestore -h LOCALHOST:27017 -d mongodb dump/mongodb/

     Example: mongorestore -h LOCALHOST:27017 -d suremdmdb dump/suremdmdb/> 

    Note: The commands mentioned above are just for an example. It may vary based on the server configuration.

 

Upgrade MongoDB 4.0.X to 4.2.8 


1.  Take backup of On-premise MongoDB database.

2.  At the Command prompt, run the following command and press Enter. 

 < mongodump --db mondodb_name > 

 Example: < mongodump --db suremdmdb >

3.  Open the link given below:

https://www.mongodb.com/try/download/community

4.  Click On-Premises.

  


5.  Select the following options and click Download.

  • Version - 4.2.8
  • Platform - Windows
  • Package - Zip 

     


6.  Extract the mongodb-win32-x86_64-2012plus-4.2.8.zip file.

7.  Open extracted folder and copy all the files.

       

8.  Stop the MongoDB service.

       

    

9.  Navigate to path C:\Program Files\MongoDB\Server\4.0

10.Replace all the files present in this path with the files copied in step no.7 except data and log folders.

 

11. Start the MongoDB service. 

12.Open MongoDB shell in command prompt to verify the latest upgraded MongoDB version.



Upgrade MongoDB 4.2.X to latest 

 

1.  Download latest MongoDB from the link given below:

https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2012plus-4.2.8-signed.msi

2.  Take backup of MongoDB. 

3.  Install the latest version of MongoDB. 

4.  Once successfully installed, open MongoDB shell in the command prompt to verify the latest upgraded MongoDB.