Retiring MongoDB after upgrading to AIR v4.37+
This guide is for self-hosted and air-gapped environments that have already upgraded to AIR v4.37 or later.
It applies to:
- Single-tier deployments (
/opt/binalyze-air/docker-compose.yml) - Two-tier deployments (
/opt/binalyze-air-db/docker-compose.yml)
Why MongoDB is no longer needed
Section titled “Why MongoDB is no longer needed”From v4.37 onward, Timeline data is stored in PostgreSQL. MongoDB is no longer required for normal AIR operations.
Keeping an unused MongoDB container has drawbacks:
- Security scan noise from CVEs in an unused image
- Extra CPU, RAM, and disk usage
- Operational overhead in upgrades and image management (especially in air-gapped environments)
Is removal mandatory?
Section titled “Is removal mandatory?”No. AIR v4.37+ can still run if the MongoDB container remains in place.
However, removal is strongly recommended. Starting with v4.38+, air.mongo images are no longer shipped, which can create avoidable image-pull and maintenance issues in environments that pin tags.
Before you begin
Section titled “Before you begin”- Confirm your Console is running v4.37 or newer in Settings > General > Version.
- Create an AIR backup in Settings > Backup History > Backup Now.
- Optionally create a VM snapshot for rollback safety.
Step 1: Stop running containers
Section titled “Step 1: Stop running containers”Single-tier
Section titled “Single-tier”cd /opt/binalyze-airdocker compose downTwo-tier
Section titled “Two-tier”cd /opt/binalyze-airdocker compose downcd /opt/binalyze-air-dbdocker compose downStep 2: Edit docker-compose and remove MongoDB
Section titled “Step 2: Edit docker-compose and remove MongoDB”Open the compose file for your deployment type:
sudo nano /opt/binalyze-air/docker-compose.ymlsudo nano /opt/binalyze-air-db/docker-compose.ymlRemove the entire mongodb: service block and any depends_on references to MongoDB.
Keep the ./volumes/mongodb directory for now. Delete it only after validating that you no longer need legacy Timeline data from versions earlier than v4.37.
Step 3: Start containers again
Section titled “Step 3: Start containers again”Single-tier
Section titled “Single-tier”cd /opt/binalyze-airdocker compose up -d --remove-orphansTwo-tier
Section titled “Two-tier”cd /opt/binalyze-air-dbdocker compose up -d --remove-orphanscd /opt/binalyze-airdocker compose up -dStep 4: Security cleanup (required)
Section titled “Step 4: Security cleanup (required)”If your environment is scanned by vulnerability tooling, remove unused image layers:
docker image prune -aRemoving only the MongoDB container is not enough. The image should also be removed to avoid false-positive findings from unused, unpatched CVEs.
Step 5: Verify
Section titled “Step 5: Verify”- Confirm MongoDB is no longer running:
docker ps | grep mongoNo output is expected.
- In the AIR UI, open Timeline and verify data is still visible.
Do I lose old Timeline data?
Section titled “Do I lose old Timeline data?”No. Timeline was migrated to PostgreSQL in v4.37. Data created after upgrade is stored in PostgreSQL.
Will future upgrades break if MongoDB is still present?
Section titled “Will future upgrades break if MongoDB is still present?”Not immediately, but the unused service remains a maintenance burden. Removing it is recommended.
Can I delete ./volumes/mongodb?
Section titled “Can I delete ./volumes/mongodb?”Yes, once you have confirmed you no longer need legacy Timeline data from versions earlier than v4.37.
Does this apply to SaaS?
Section titled “Does this apply to SaaS?”No. SaaS environments are managed by Binalyze.
Need help?
Section titled “Need help?”If you encounter issues, contact Support at [email protected].