This documentation is for the end of life version of Percona Server for MongoDB and is no longer supported. You may want to see the current documentation.
Upgrading from Percona Server for MongoDB 3.6 to 4.0ΒΆ
- Availability
MongoRocks has been removed from Percona Server for MongoDB 4.0
To upgrade Percona Server for MongoDB to version 4.0, you must be running version 3.6. Upgrades from earlier versions are not supported.
Before upgrading your production Percona Server for MongoDB deployments, test all your applications in a testing environment to make sure they are compatible with the new version. For more information, see Compatibility Changes in MongoDB 4.0
The general procedure for performing an in-place upgrade (where your existing data and configuration files are preserved) includes the following steps:
Stop the mongod instance
Enable Percona repository for new version
Install new packages. Old packages are automatically considered obsolete and removed
Start the mongod instance
It is recommended to upgrade Percona Server for MongoDB from official Percona repositories using the corresponding package manager for your system. For more information, see Installing Percona Server for MongoDB.
Warning
Perform a full backup of your data and configuration files before upgrading.
Stop the
mongod
instance:$ sudo systemctl stop mongod
Enable Percona repository for Percona Server for MongoDB 4.0:
$ sudo percona-release enable psmdb-40
Update the local cache:
$ sudo apt update
Install Percona Server for MongoDB 4.0 packages:
$ sudo apt install percona-server-mongodb
Start the
mongod
instance:$ sudo systemctl start mongod
For more information, see Installing Percona Server for MongoDB on Debian and Ubuntu.
Stop the
mongod
instance:$ sudo systemctl stop mongod
Enable Percona repository for Percona Server for MongoDB 4.0:
$ sudo percona-release enable psmdb-40
Install Percona Server for MongoDB 4.0 packages:
Start the
mongod
instance:$ sudo systemctl start mongod
For more information, see Installing Percona Server for MongoDB on Red Hat Enterprise Linux and CentOS.
After the upgrade, Percona Server for MongoDB is started with the feature set of 3.6 version. Assuming that your applications are compatible with the new version, enable 4.0 version features. Run the following command against the admin
database:
db.adminCommand( { setFeatureCompatibilityVersion: "4.0" } )
See also
- MongoDB Documentation: