100 MONGODB CLUSTER REORGANIZATION

Documentation for Sessions

Session 100: MongoDB Cluster Reorganization

Date: February 8, 2026 Status: Complete (gspace1), Pending Decision (gmodules1) Branch: session-100


Summary

Reorganized MongoDB Atlas infrastructure to properly name clusters by purpose, migrated documentation data, and provisioned production-ready Atlas cluster for Vitto backend.

Changes Made

1. Data Migration: test-modules -> GoGrab-Docs

2. Environment Variable Rename

Old Name New Name Rationale
MONGODB_CONNECTION_STRING_TEST_MODULES MONGODB_CONNECTION_STRING_DOCS Reflects actual purpose (docs, not test modules)
VITTO_MONGODB_URI (localhost) VITTO_MONGODB_URI (Atlas SRV) Production-ready Atlas cluster

3. New Vitto Atlas Cluster

4. Source Code Changes (gspace1)

File Change
.env.local Renamed var + new connection strings
apis/backend-docs-api/src/app/app.module.ts connectionStringKey: 'MONGODB_CONNECTION_STRING_DOCS'
apis/backend-docs-api/src/app/constants.ts Updated comment
apis/backend-docs-api/src/main.ts Updated comments + log message
apis/backend-ai-api/src/app/infrastructure/services/session-docs.service.ts Updated comment
tools/scripts/database/env-loader.js New getMongoDBDocsConnectionString(), deprecated old function with backward compat
tools/scripts/database/sync-session-docs-to-mongodb.js Updated comment
deployment/ENV_LOCAL_TEMPLATE.md Updated template var name
deployment/deploy-docs-api.sh Updated Railway instructions

5. Build Verification


Current MongoDB Atlas Architecture (Post-Migration)

Cluster Host Tier Purpose Databases
GoGrabSpace gograbspace.dgajj2t.mongodb.net M10 Main platform gograb-api, ai-context, ai-agents, ai-memory, ai-mcp-dev, ai-archive
GoGrab-Docs gograb-docs.z422vsq.mongodb.net Flex Documentation docs-database
Vitto vitto.urgh5aw.mongodb.net Flex Vitto Super-Agent vitto-mind
test-modules test-modules.7hkxufn.mongodb.net — TO BE DELETED docs-database (migrated)

Pending: gmodules1 Decision Required

The gmodules1 monorepo actively uses test-modules cluster:

Options:

  1. Point gmodules1 to gograbspace main cluster (storage-system already defaults to it)
  2. Create a dedicated GoGrab-Modules cluster for module testing
  3. Remove MongoDB config entirely if not actively needed

Recommendation: Option 1 is simplest. The sample_supplies database is likely Atlas sample data, and storage-system defaults to gograbspace anyway. Simply update .env.local and .env to point to gograbspace.


Pending: Railway Deployment Updates

When deploying, update these Railway environment variables:


Pending: test-modules Cluster Deletion - ignore this for now

Only delete after:

  1. Verifying backend-docs-api connects to GoGrab-Docs successfully in production
  2. Deciding gmodules1 migration path
  3. Confirming no other projects reference test-modules