UniFi MCP Server - Disaster Recovery Guide
Last Updated: 2025-11-28 Version: 0.2.0 This guide provides comprehensive instructions for backup, restore, and disaster recovery operations using the UniFi MCP Server.Table of Contents
- Overview
- Backup Types
- Backup Best Practices
- Creating Backups
- Downloading Backups
- Validating Backups
- Restoring from Backup
- Disaster Recovery Scenarios
- Cross-Controller Migration
- Troubleshooting
Overview
The UniFi MCP Server provides enterprise-grade backup and restore capabilities with built-in safety mechanisms:- ✅ Automatic Pre-Restore Backups - Safety backup created before every restore
- ✅ Mandatory Confirmation - All destructive operations require explicit confirmation
- ✅ Dry-Run Mode - Test operations without execution
- ✅ Backup Validation - Integrity checks before restore
- ✅ Audit Logging - Complete audit trail of all operations
- ✅ SHA-256 Checksums - File integrity verification
Backup Types
Network Backup (.unf files)
- Contents: Network settings and device configurations only
- Size: Typically 5-10 MB
- Creation Time: 1-2 minutes
- Use Cases:
- Daily automated backups
- Quick configuration snapshots
- Network-only changes
- Restores: Networks, VLANs, firewall rules, WiFi configs, device settings
System Backup (.unifi files)
- Contents: Complete OS, application, and device configurations
- Size: Typically 50-100 MB
- Creation Time: 5-10 minutes
- Use Cases:
- Before major upgrades
- Complete system snapshots
- Controller migrations
- Restores: Everything including OS settings, certificates, user accounts
Backup Best Practices
Retention Strategy
3-2-1 Backup Rule:- 3 copies of your data (original + 2 backups)
- 2 different storage media (local + cloud)
- 1 offsite backup
Before Major Operations
Always create a backup before:- ✅ Firmware upgrades
- ✅ Network reconfigurations
- ✅ Firewall rule changes
- ✅ Adding/removing devices
- ✅ Controller migrations
- ✅ Configuration imports
Storage Recommendations
- Local Storage: Keep 3-5 recent backups on controller
- Network Storage: Archive to NAS weekly
- Cloud Storage: Enable cloud backup for critical sites
- Off-Site: Monthly backup to external location
Creating Backups
Network Backup (Daily)
System Backup (Monthly)
Dry-Run Mode
Test backup creation without executing:Downloading Backups
List Available Backups
Download to Local Storage
Automated Backup Script
Validating Backups
ALWAYS validate backups before restore operations.Restoring from Backup
Pre-Restore Checklist
Before restoring a backup:- Validate the backup file using
validate_backup - Notify users of potential downtime
- Document current state (screenshots, configs)
- Verify backup age - is it recent enough?
- Check controller version compatibility
- Ensure network access for download after restart
- Enable pre-restore backup (automatic safety backup)
Safe Restore Procedure
Emergency Rollback
If restore fails or causes issues:Disaster Recovery Scenarios
Scenario 1: Controller Hardware Failure
Situation: Controller hardware fails, need to recover to new hardware. Recovery Steps:- Install new controller with same UniFi OS version
- Complete initial setup (don’t configure anything)
- Restore from last system backup:
- Wait for controller restart (5-10 minutes)
- Verify all devices reconnect
- Test critical functionality
Scenario 2: Bad Configuration Change
Situation: Configuration change breaks network, need to rollback. Recovery Steps:-
List recent backups:
-
Validate backup:
-
Restore with safety backup:
Scenario 3: Firmware Upgrade Failure
Situation: Firmware upgrade causes issues, need to revert. Recovery Steps:- Use pre-upgrade backup (created before upgrade)
- Restore and downgrade:
- Wait for downgrade (may take 10-15 minutes)
- Verify device functionality
Scenario 4: Accidental Deletion
Situation: Critical firewall rule or network accidentally deleted. Recovery Steps:- Find most recent backup (hourly/daily)
- Restore specific backup:
Cross-Controller Migration
Migrating to New Controller
Scenario: Moving from old controller to new hardware or location. Steps:-
Create final backup on old controller:
-
Download backup file:
-
Setup new controller:
- Install UniFi OS (same or newer version)
- Complete initial setup (minimal config)
- Connect to MCP Server
-
Upload and restore backup on new controller
- Copy backup file to new controller
- Restore using MCP tools
-
Inform devices of new controller IP:
- Option A: DHCP Option 43
- Option B: DNS override for
unifi - Option C: Manual SSH adoption
- Monitor device adoption (may take 5-30 minutes)
Migration Checklist
- Verify UniFi OS versions compatible
- Document current device count
- Backup SSL certificates
- Note custom port configurations
- Export any external integrations
- Update DNS/DHCP for new controller IP
- Test with 1-2 devices first
- Keep old controller running during migration
- Verify all devices adopted
- Test all critical functionality
- Update documentation with new controller info
Troubleshooting
Backup Creation Fails
Symptoms: Backup operation returns error Solutions:- Check disk space:
df -h - Verify controller health: Check system logs
- Retry with dry-run mode first
- Try network backup instead of system backup
- Check retention days value (must be -1 or >0)
Restore Fails to Complete
Symptoms: Restore initiated but doesn’t finish Solutions:- Wait 10-15 minutes (controller restart takes time)
- Check controller accessibility
- Review system logs for errors
- If hung, power cycle controller
- Restore again from pre-restore backup
Pre-Restore Backup Not Created
Symptoms: Restore proceeds without safety backup Solutions:- Ensure
create_pre_restore_backup: True - Check disk space for backup
- Manually create backup before restore
- Document current config as fallback
Backup File Corrupted
Symptoms: Validation fails with checksum errors Solutions:- Re-download backup file
- Use older backup
- Check backup storage for issues
- Verify backup was fully written
- Check for disk errors on backup storage
Devices Don’t Reconnect After Restore
Symptoms: Devices show offline after restore Solutions:- Wait 5-10 minutes for auto-reconnect
- Power cycle devices
- Check network connectivity
- Verify controller IP accessible
- Force adoption via SSH if needed
- Check if firewall rules blocking management
Version Mismatch Warning
Symptoms: Backup from different UniFi version Solutions:- Check compatibility: backup version vs. current version
- Upgrade/downgrade controller if needed
- Review changelog for breaking changes
- Test restore in lab environment first
- Consider manual configuration instead
Support
For backup/restore issues:- GitHub Issues: https://github.com/enuno/unifi-mcp-server/issues
- Documentation: See
API.mdfor tool references - Security: See
SECURITY.mdfor vulnerability reporting
Last Updated: 2025-11-28 Version: 0.2.0 Maintained By: UniFi MCP Server Team
