Skip to content

Upgrade to MongoDB 8 INFRA-491#370

Open
ScottMillard wants to merge 4 commits into
masterfrom
scott/mongo_8
Open

Upgrade to MongoDB 8 INFRA-491#370
ScottMillard wants to merge 4 commits into
masterfrom
scott/mongo_8

Conversation

@ScottMillard

Copy link
Copy Markdown

This updates MongoDB to version 8 and adds instructions for the manual steps that need to be performed.

BREAKING CHANGE after merging, users must upgrade their mongodb files using the process described in the document.

After merge another commit will be done to update the readme with the actual commit SHA

@ScottMillard ScottMillard self-assigned this May 22, 2026
@ScottMillard ScottMillard requested review from jnm and noliveleger May 22, 2026 21:04
@jnm

jnm commented Jun 9, 2026

Copy link
Copy Markdown
Member

@greptileai please review

@greptile-apps

greptile-apps Bot commented Jun 9, 2026

Copy link
Copy Markdown

Greptile Summary

This PR upgrades the MongoDB image from 5.0 to 8.0 and migrates all shell scripts from the deprecated mongo CLI to mongosh, which is required for MongoDB 6+. A new upgrade guide documents the mandatory sequential upgrade path (5→6→7→8) for existing deployments.

  • docker-compose.backend.yml: image bumped from mongo:5.0 to mongo:8.0; all three mongo shell scripts (init_02_create_user.sh, post_startup.sh, upsert_users.sh) updated from mongo to mongosh.
  • doc/June-2026-Upgrade-MongoDB8.md: new step-by-step guide covering the sequential version-by-version upgrade, including the correct use of confirm: true starting from the 7.0 setFeatureCompatibilityVersion call.
  • README.md: new TOC entry and upgrade-notice section added; commit SHA and date are intentional placeholders to be filled in a follow-up commit per the PR description.

Confidence Score: 3/5

The core image bump and shell-script migration are correct, but the README table-of-contents link will be broken for anyone clicking it until it is fixed.

The README TOC anchor #important-notice-when-upgrading-june-2026 does not match the slug GitHub auto-generates from the heading, so the link lands nowhere. The background: true options in the index-creation scripts are silently ignored by MongoDB 8.0 and carry no runtime risk, only cleanup debt.

README.md — the TOC anchor needs to be corrected before or alongside the follow-up commit that fills in the real SHA and date.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Existing deployment\nmongo:5.0] --> B{Upgrade required?}
    B -- Yes --> C[Backup MongoDB\ndata volumes]
    C --> D[Set image to mongo:6.0\nStart container]
    D --> E[setFeatureCompatibilityVersion: '6.0'\nno confirm flag needed]
    E --> F[Set image to mongo:7.0\nStart container]
    F --> G["setFeatureCompatibilityVersion: '7.0'\nconfirm: true required"]
    G --> H[Set image to mongo:8.0\nStart container]
    H --> I["setFeatureCompatibilityVersion: '8.0'\nconfirm: true required"]
    I --> J[Restore full stack\npython3 run.py]
    B -- No / New install --> K[mongo:8.0 starts directly\nmongosh used by all scripts]
    J --> L([Done])
    K --> L
Loading

Comments Outside Diff (4)

  1. mongo/post_startup.sh, line 24-29 (link)

    P2 The background: true option has been deprecated since MongoDB 4.2 and is silently ignored in MongoDB 8.0. Since all index builds in MongoDB 4.2+ are already non-blocking by default, this option is dead code and worth removing to keep the scripts clean.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

  2. mongo/post_startup.sh, line 34-39 (link)

    P2 Same background: true removal for the formhub/uuid index — deprecated since MongoDB 4.2 and ignored in 8.0.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

  3. mongo/post_startup.sh, line 45-51 (link)

    P2 Same background: true removal for the _userform_id + _submission_time index — deprecated since MongoDB 4.2 and ignored in 8.0.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

  4. mongo/post_startup.sh, line 56-61 (link)

    P2 Same background: true removal for the _xform_id_string index — deprecated since MongoDB 4.2 and ignored in 8.0.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Reviews (1): Last reviewed commit: "Updating README" | Re-trigger Greptile

Comment thread README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants