Disaster Recovery Guide β
This guide provides step-by-step procedures for recovering from various failure scenarios using MeshMonitor's system backup and restore capabilities.
Quick Recovery Checklist β
Before disaster strikes, ensure you have:
- β Automated backups enabled with at least 7 days retention
- β Recent backup downloaded and stored off-site
- β Docker compose file backed up (your configuration)
- β Environment variables documented (.env file backed up)
- β Tested restore procedure at least once
Common Disaster Scenarios β
Scenario 1: Complete Hardware Failure β
Situation: Your server has failed and you need to restore MeshMonitor to new hardware.
Prerequisites:
- Downloaded backup archive (.tar.gz) from old system
- New server with Docker installed
- Your original docker-compose.yml and .env files
Recovery Steps:
Set up new server:
bash# Install Docker and Docker Compose if needed curl -fsSL https://get.docker.com | sh sudo usermod -aG docker $USERCopy configuration files:
bashmkdir -p ~/meshmonitor cd ~/meshmonitor # Copy your docker-compose.yml and .env files hereCreate volume and restore backup:
bash# Create the data volume docker volume create meshmonitor_meshmonitor-data # Extract backup to volume docker run --rm \ -v meshmonitor_meshmonitor-data:/data \ -v $(pwd):/backup \ alpine:latest \ sh -c "mkdir -p /data/system-backups && \ tar -xzf /backup/meshmonitor-backup-2025-11-08.tar.gz -C /data/system-backups/"Update docker-compose.yml:
yamlservices: meshmonitor: image: ghcr.io/yeraze/meshmonitor:latest environment: - RESTORE_FROM_BACKUP=2025-11-08_143026 # Your backup directory name volumes: - meshmonitor-data:/data # ... rest of your configStart container:
bashdocker compose up -dVerify restore:
bash# Check logs docker logs meshmonitor | grep -i restore # Should see: "β System restore completed: X tables, Y rows..." # Test API curl http://localhost:8080/api/healthRemove RESTORE_FROM_BACKUP (optional):
Automatic Protection: MeshMonitor automatically prevents re-restoring the same backup on subsequent restarts. A marker file is created at
/data/.restore-completedafter successful restore.However, it's best practice to remove the environment variable:
bash# Edit docker-compose.yml and remove or comment out: # - RESTORE_FROM_BACKUP=2025-11-08_143026 docker compose up -dNote: If you restart without removing this variable, the restore will be safely skipped with a warning message in the logs.
Recovery Time: 5-10 minutes
Scenario 2: Database Corruption β
Situation: Your MeshMonitor database is corrupted but the container and backups are intact.
Recovery Steps:
Stop the container:
bashdocker compose stop meshmonitorIdentify latest good backup:
bashdocker run --rm \ -v meshmonitor_meshmonitor-data:/data \ alpine:latest \ ls -lh /data/system-backups/Add RESTORE_FROM_BACKUP to compose file:
yamlenvironment: - RESTORE_FROM_BACKUP=2025-11-08_143026Restart container:
bashdocker compose up -dVerify and cleanup:
bash# Check restore succeeded docker logs meshmonitor | grep "restore completed" # Remove RESTORE_FROM_BACKUP and restart docker compose up -d
Recovery Time: 2-5 minutes
Scenario 3: Accidental Data Deletion β
Situation: You accidentally deleted important data and need to restore from a backup.
Recovery Steps:
Stop further operations immediately:
bashdocker compose stop meshmonitorCreate a current backup (even if corrupted):
bash# Start container temporarily to create final backup docker compose up -d # Wait for startup curl -X POST http://localhost:8080/api/system/backup \ -H "Authorization: Bearer YOUR_TOKEN" docker compose stopChoose recovery method:
Option A: Full Restore (Recommended)
- Follow Scenario 2 steps above
- All data from backup timestamp will be restored
- Any data created after backup timestamp will be lost
Option B: Selective Recovery (Advanced)
- Extract specific tables from backup JSON
- Manually import using SQL
- Requires database expertise
- Risk of data inconsistency
Recovery Time: 5-10 minutes (Option A), 30+ minutes (Option B)
Scenario 4: Migration to New Container Version β
Situation: Upgrading to a new MeshMonitor version after a long period.
Recovery Steps:
Create backup on old version:
bash# Via UI: Settings β System Backup β Create Backup Now # Or via API: curl -X POST http://localhost:8080/api/system/backup \ -H "Authorization: Bearer YOUR_TOKEN"Download backup archive:
bash# Via UI: Download button # Or via API: curl -O http://localhost:8080/api/system/backup/download/2025-11-08_143026 \ -H "Authorization: Bearer YOUR_TOKEN"Update image version:
yamlservices: meshmonitor: image: ghcr.io/yeraze/meshmonitor:v2.16.0 # New version environment: - RESTORE_FROM_BACKUP=2025-11-08_143026Start new version:
bashdocker compose pull docker compose up -dVerify migration:
bash# Check logs for schema migration docker logs meshmonitor | grep -i "migration\|schema" # Should see: "Schema migration required: X β Y" # Followed by: "β System restore completed..."
Recovery Time: 5-10 minutes
Note: Backups are forward-compatible (old backups work with new versions), but not backward-compatible (new backups may not work with old versions).
Advanced Recovery Scenarios β
Recovering with Partial Volume β
Situation: You have the Docker volume but no recent backup.
Steps:
Create an immediate backup:
bashdocker compose up -d # Access UI and create backup # Download the backupStore this backup off-site for future recovery
Cross-Platform Migration β
Situation: Moving from x86_64 to ARM64 (or vice versa).
Steps: Same as Scenario 1, but ensure you:
- Use the appropriate Docker image for your architecture
- Backup format is architecture-independent
- Encrypted secrets remain compatible
Recovering from Read-Only Volume β
Situation: Volume mounted read-only or filesystem corruption.
Steps:
Extract data using temporary container:
bashdocker run --rm \ -v meshmonitor_meshmonitor-data:/source:ro \ -v $(pwd)/recovery:/dest \ alpine:latest \ cp -r /source/system-backups /dest/Create new volume and restore as per Scenario 1
Recovery Validation β
After any recovery, perform these checks:
1. Health Check β
curl http://localhost:8080/api/health
# Expected: {"status":"ok","uptime":...}2. Authentication Test β
# Login with admin account
curl -X POST http://localhost:8080/api/auth/login \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"your-password"}'3. Data Integrity β
# Check node count
curl http://localhost:8080/api/nodes | jq 'length'
# Check message count
curl http://localhost:8080/api/messages?limit=10 | jq '.messages | length'
# Check settings
curl http://localhost:8080/api/settings4. Audit Log Review β
- Navigate to Settings β Security β Audit Log
- Verify restore event is logged
- Check for any errors during restore
Backup Best Practices β
Daily Operations β
Monitor Backup Status:
- Check Settings β System Backup weekly
- Verify automated backups are running
- Ensure disk space is sufficient
Test Restore Quarterly:
- Spin up test container with latest backup
- Verify all data is accessible
- Document any issues
Off-Site Storage:
- Download backups weekly/monthly
- Store in separate location (cloud storage, NAS)
- Encrypt backup archives for transport
Before Major Changes β
Always create a backup before:
- Upgrading MeshMonitor version
- Modifying database directly
- Changing authentication configuration
- Adding/removing users with admin privileges
- Bulk automation changes
Backup Retention Strategy β
Recommended retention schedule:
- Daily backups: Last 7 days
- Weekly backups: Last 4 weeks
- Monthly backups: Last 12 months
Implementation:
# In Settings β System Backup
enabled: true
maxBackups: 7 # Keep 7 daily backups
backupTime: "02:00" # Run at 2 AM
# Manually download backups weekly and monthly for long-term retentionEmergency Contacts β
Before disaster strikes, document:
Backup Locations:
- Local:
/var/lib/docker/volumes/meshmonitor_meshmonitor-data/_data/system-backups/ - Off-site: [Your cloud storage location]
- Archive: [Your archive location]
- Local:
Configuration Files:
- docker-compose.yml: [Location]
- .env file: [Location]
- MESHTASTIC_HOST: [IP/hostname]
Access Credentials:
- Admin username: [Documented in password manager]
- Admin password: [Documented in password manager]
- Docker registry: [If using private registry]
Troubleshooting Recovery β
"Restore failed: table X has no column Y" β
Cause: Trying to restore newer backup to older MeshMonitor version
Solution: Upgrade MeshMonitor to latest version first
"Backup directory not found" β
Cause: RESTORE_FROM_BACKUP path incorrect
Solution:
# List available backups
docker exec meshmonitor ls /data/system-backups
# Fix environment variable with correct dirname"Integrity validation failed" β
Cause: Backup corrupted during storage or transfer
Solution: Restore from earlier backup or re-download archive
Container won't start after restore β
Cause: Incompatible configuration or environment variables
Solution:
- Remove RESTORE_FROM_BACKUP and check logs
- Verify all required environment variables are set
- Check docker-compose.yml syntax
- Review container logs:
docker logs meshmonitor
"Restore already completed" warning β
Cause: RESTORE_FROM_BACKUP is still set after a successful restore
Explanation: MeshMonitor automatically prevents re-restoring the same backup to protect against data loss. A marker file tracks the last restored backup.
To restore again (same backup):
# Remove the marker file
docker exec meshmonitor rm /data/.restore-completed
# Restart container
docker compose restartTo restore a different backup:
# Just change the environment variable to a different backup
# in docker-compose.yml, then restart
docker compose up -dSee Also β
- System Backup Features - Complete backup feature documentation
- Settings Guide - Configuration options
- Security Best Practices - Securing your backups