Upgrade MongoDB
MongoDB is a database service used by CircleCI server. This page describes how to upgrade MongoDB to version 4.4.15
.
MongoDB 3.6.22
is shipped with CircleCI server 4.2.
Prerequisites
-
Ensure backups have been taken. You will need a backup of MongoDB to restore to in case anything goes wrong during the upgrade progress
-
You are prepared to modify the
values.yaml
-
helm upgrade
will work from your system to upgrade the cluster -
MongoDB root password is available
Scripted Upgrade
We have created a shell script which may be used to upgrade your cluster’s MongoDB instance here. If you wish, you may use the following instructions to manually upgrade your cluster’s MongoDB
Manual Upgrade
1. Upgrade from MongoDB 3.6 to 4.0
-
Your
values.yaml
should contain the following snippet:mongodb: image: tag: 3.6.22-debian-9-r38
To begin the upgrade process, change the tag to
4.0.27-debian-9-r118
:mongodb: image: tag: 4.0.27-debian-9-r118
-
Run
helm upgrade
to update your installation. -
Once the
helm upgrade
has completed and MongoDB has rolled, you will need toexec
into the pod (with the root password handy) to modify the compatibility version. (Be sure to replace<password>
with your MongoDB root password.)kubectl exec -it mongodb-0 -- mongo -u root -p <password> db.adminCommand( { setFeatureCompatibilityVersion: "4.0" } )
-
You should get a
{ "ok" : 1 }
response from Mongo. Exit out of the MongoDB shell and pod.
2. Upgrade from MongoDB 4.0 to 4.2
-
Change the tag to
4.2.17-debian-10-r99
:mongodb: image: tag: 4.2.17-debian-10-r99
-
Run
helm upgrade
to update your installation. -
Once the
helm upgrade
has completed and MongoDB has rolled, you will need toexec
into the pod (with the root password handy) to modify the compatibility version. (Be sure to replace<password>
with your MongoDB root password.)kubectl exec -it mongodb-0 -- mongo -u root -p <password> db.adminCommand( { setFeatureCompatibilityVersion: "4.2" } )
-
You should get
{ "ok" : 1 }
again. Exit out of the shell and pod.
3. Upgrade from MongoDB 4.2 to 4.4
-
Change the tag one more time to
4.4.15-debian-10-r8
:mongodb: image: tag: 4.4.15-debian-10-r8
-
Run
helm upgrade
to update your installation. -
Once the
helm upgrade
has completed and MongoDB has rolled, you will need toexec
into the pod (with the root password handy) to modify the compatibility version. (Be sure to replace<password>
with your MongoDB root password.)kubectl exec -it mongodb-0 -- mongo -u root -p <password> db.adminCommand( { setFeatureCompatibilityVersion: "4.4" } )
-
Once you receive
{ "ok" : 1 }
, you have successfully upgraded your MongoDB to 4.4.15.
Help make this document better
This guide, as well as the rest of our docs, are open source and available on GitHub. We welcome your contributions.
- Suggest an edit to this page (please read the contributing guide first).
- To report a problem in the documentation, or to submit feedback and comments, please open an issue on GitHub.
- CircleCI is always seeking ways to improve your experience with our platform. If you would like to share feedback, please join our research community.
Need support?
Our support engineers are available to help with service issues, billing, or account related questions, and can help troubleshoot build configurations. Contact our support engineers by opening a ticket.
You can also visit our support site to find support articles, community forums, and training resources.
CircleCI Documentation by CircleCI is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.