Skip to content

[ONPREM-2564] - Provide script to upgrade to Mongo 7.0#67

Merged
imlogang merged 4 commits intomainfrom
ONPREM-2564/upgrade-mongo-7.0
Nov 18, 2025
Merged

[ONPREM-2564] - Provide script to upgrade to Mongo 7.0#67
imlogang merged 4 commits intomainfrom
ONPREM-2564/upgrade-mongo-7.0

Conversation

@imlogang
Copy link
Contributor

⚙️ Issue
https://circleci.atlassian.net/browse/ONPREM-2564

Fix
This script provides the ability to upgrade from Mongo 4.4 to 7.0 and provides an output to put in your server's vaules.yaml to redeploy.

Tests
This was tested on both a 4.7.12 instance and a 4.9.0 instance.

  • Tested Updating Existing Instance
  • Installed on new instance

Provide README with instructions to upgrade to Mongo 7.0
@imlogang imlogang marked this pull request as draft October 31, 2025 19:26
local image_tag="$1"
local major_version="$2"

if [ "$major_version" -ge 5 ]; then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replacing the liveness/readiness Probes is needed as a patch during the upgrade due to anything above Mongo 5.0 replacesmongo with mongosh.


if [ "$major_version" -ge 7 ]; then
echo "Note: MongoDB 7.0+ upgrade is one-way and cannot be downgraded without support assistance"
result=$(kubectl -n "$NAMESPACE" exec "$MONGO_POD" -- $shell_cmd -u "$MONGODB_USERNAME" -p "$MONGODB_PASSWORD" --eval "db.adminCommand({ setFeatureCompatibilityVersion: '$1', confirm: true })")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the confirm: true command here is due to Mongo 7.0 not being able to be downgraded after the fact, and this is to confirm you understand that.

echo " image:"
echo " tag: 7.0.15-debian-12-r2"
echo " pullSecrets: []"
echo " livenessProbe:"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the comment above, mongo is replaced with mongosh, which means the current hardcoded probes will not work.

Luckily, the chart does allow for custom probes, which is what this prints to add to your values.yaml.

@imlogang imlogang marked this pull request as ready for review November 18, 2025 17:26
@imlogang imlogang merged commit e153c65 into main Nov 18, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants