- ensure proper feature compatibility version:
sudo mongo
db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } ) -> should return current version (4.2), if not set it:
db.adminCommand( { setFeatureCompatibilityVersion: "4.2" } ) -> set the version to currently installed version
- backup mongodb.conf file:
sudo cp /etc/mongod.conf ~/mongod.conf.bak
- shutdown mongo service:
sudo service mongod stop
- delete mongodb installation:
sudo apt-get -y purge mongodb-org*
(the data stays intact) - intall new mongodb version with following steps: https://www.mongodb.com/docs/v4.4/tutorial/install-mongodb-on-ubuntu/#install-mongodb-community-edition
- restore mongodb.conf backup:
sudo mv ~/mongod.conf.bak /etc/mongod.conf
- restart mongodb service: https://www.mongodb.com/docs/v4.4/tutorial/install-mongodb-on-ubuntu/#start-mongodb-1
sudo service mongod stop
sudo service mongod start
- Enable backwards-incompatible 4.4 features:
db.adminCommand( { setFeatureCompatibilityVersion: "4.4" } )