System Backup and Restore on MikroTik RouterOS
System Backup and Restore on MikroTik RouterOS
Section titled âSystem Backup and Restore on MikroTik RouterOSâRouterOS Version: 7.x+ Difficulty: Beginner Estimated Time: 20 minutes
TL;DR (Quick Start)
Section titled âTL;DR (Quick Start)âFor the impatient: hereâs the 30-second version.
# Create encrypted backup/system backup save name=router-backup password=SecureBackupPassword123
# Restore from backup (router will reboot)/system backup load name=router-backup password=SecureBackupPassword123Overview
Section titled âOverviewâSystem backup and restore in RouterOS provides two fundamentally different approaches to configuration management: binary backups for complete system cloning and text exports for selective configuration sharing. Understanding when and how to use each method is critical for effective network management and disaster recovery.
This guide explains both approaches, their strengths and limitations, and the essential practices that separate reliable backup strategies from data loss disasters.
The Two Backup Paradigms
Section titled âThe Two Backup Paradigmsâ1. Binary Backup (.backup files)
Section titled â1. Binary Backup (.backup files)âA binary backup creates a complete snapshot of the routerâs configuration in RouterOSâs internal format. Itâs designed for exact restoration to the same device.
Use when: You need to restore the complete configuration to the same router model after hardware failure, RouterOS corruption, or before major changes.
2. Text Export (.rsc files)
Section titled â2. Text Export (.rsc files)âA text export generates human-readable RouterOS commands that recreate specific parts of the configuration. Itâs designed for selective restoration and cross-device migration.
Use when: You need to copy specific configurations between different devices, create templates, or maintain version-controlled configuration snippets.
The Critical Difference
Section titled âThe Critical DifferenceâBinary backups preserve everything including MAC addresses, certificates, and device-specific data, but only work reliably on the same RouterOS version and similar hardware.
Text exports are portable and version-flexible but exclude sensitive data like passwords, certificates, and some system-specific settings.
Understanding RouterOS Backup Architecture
Section titled âUnderstanding RouterOS Backup ArchitectureâRouterOS stores configuration in multiple layers:
Key insight: Binary backups capture the complete state, while exports only capture user-modified configuration. Default system entries (marked with * flag) are recreated automatically on import.
Binary Backup Deep Dive
Section titled âBinary Backup Deep DiveâEncryption and Security
Section titled âEncryption and SecurityâSince RouterOS v6.43, backup encryption behavior changed significantly:
- No password provided: Backup is unencrypted (major security risk)
- Password provided: Backup encrypted with AES-256-SHA256
- Legacy RC4: Available for compatibility with older versions (insecure)
Whatâs Included vs. Excluded
Section titled âWhatâs Included vs. ExcludedâIncluded in binary backup:
- Complete router configuration
- User accounts (usernames only, not passwords)
- Interface settings and IP configuration
- All RouterOS package configurations
- Device MAC addresses and identity
- Installed certificates and keys
Excluded from binary backup:
- The Dude database (separate export required)
- User Manager database (separate export required)
- Log files and temporary data
- Package files themselves (.npk files)
Version Compatibility
Section titled âVersion CompatibilityâBinary backups are version-sensitive:
- Same version: Full compatibility guaranteed
- Minor version difference: Usually works but test thoroughly
- Major version difference: High risk of failure or corruption
- Downgrade: Generally not supported
Configuration Steps
Section titled âConfiguration StepsâThis section demonstrates creating and restoring a basic encrypted backup.
Step 1: Create Encrypted Backup
Section titled âStep 1: Create Encrypted BackupâCreate a backup with strong encryption:
/system backup save name=router-backup password=SecureBackupPassword123Step 2: Verify Backup Creation
Section titled âStep 2: Verify Backup CreationâCheck that the backup file was created successfully:
/file print where name~"backup"Verification
Section titled âVerificationâConfirm the backup was created and is properly encrypted:
/file print where name~"router-backup"Expected Output:
# NAME TYPE SIZE CREATION-TIME0 router-backup.backup backup 15.2KiB jan/09/2026 10:30:15Check backup details:
/system backup printAdvanced Backup Strategies
Section titled âAdvanced Backup StrategiesâAutomated Backup with Email
Section titled âAutomated Backup with EmailâSet up automatic daily backups sent via email:
# Configure email settings/tool e-mail set address=smtp.gmail.com port=587 tls=yes user=your-email@gmail.com password=app-password
# Create backup script/system script add name=daily-backup source={ /system backup save name=("backup-" . [/system clock get date]) :delay 5s /tool e-mail send to=admin@company.com subject="Daily Backup" body="Daily backup attached" file=("backup-" . [/system clock get date] . ".backup")}
# Schedule daily execution/system scheduler add name=backup-schedule start-time=02:00:00 interval=1d on-event=daily-backupCloud Backup Integration
Section titled âCloud Backup IntegrationâRouterOS v6.44+ supports MikroTik Cloud backup:
# Enable cloud backup (requires MikroTik account)/ip cloud set ddns-enabled=yes update-time=yes/ip cloud backup-settings set enabled=yesMulti-Device Backup Strategy
Section titled âMulti-Device Backup StrategyâFor managing multiple routers:
# Standardized naming convention/system backup save name=([/system identity get name] . "-" . [/system clock get date]) password=CompanyBackupPassword2024
# Include device info in filename/system backup save name=([/system routerboard get model] . "-" . [/system identity get name] . "-" . [/system clock get date])Text Export Strategies
Section titled âText Export StrategiesâSelective Configuration Export
Section titled âSelective Configuration ExportâExport specific configuration sections:
# Export only firewall configuration/ip firewall export file=firewall-config
# Export only interface configuration/interface export file=interface-config
# Export everything except sensitive data/export file=full-config show-sensitive=noTemplate Creation
Section titled âTemplate CreationâCreate reusable configuration templates:
# Export base configuration for new sites/export compact file=site-template show-sensitive=no
# Export specific service configurations/ip dhcp-server export file=dhcp-template/routing ospf export file=ospf-templateVersion Control Integration
Section titled âVersion Control IntegrationâExport configurations for version control:
# Create timestamped exports/export file=("config-" . [/system clock get date] . "-" . [/system clock get time]) compact show-sensitive=no
# Export with verbose comments for documentation/export file=config-documented verboseRestoration Procedures
Section titled âRestoration ProceduresâBinary Backup Restoration
Section titled âBinary Backup RestorationâCritical: Always test restoration on non-production devices first.
# Load backup (router will reboot automatically)/system backup load name=router-backup password=SecureBackupPassword123
# Confirm restorationRestore and reboot? [y/N]: yPost-restoration checklist:
- Verify all interfaces are operational
- Check routing table and connectivity
- Confirm services are running (DHCP, DNS, etc.)
- Validate firewall rules are active
- Test remote access methods
Text Export Import
Section titled âText Export Importâ# Import complete configuration/import file-name=full-config.rsc
# Import with verbose mode for debugging/import file-name=config.rsc verbose=yes
# Dry-run import to check for errors/import file-name=config.rsc verbose=yes dry-run=yesSelective Import
Section titled âSelective ImportâImport only specific sections:
# Reset to defaults first (optional)/system reset-configuration no-defaults=yes skip-backup=yes
# Import base configuration/import file-name=base-config.rsc
# Import site-specific settings/import file-name=site-specific.rscDisaster Recovery Scenarios
Section titled âDisaster Recovery ScenariosâComplete Hardware Failure
Section titled âComplete Hardware Failureâ- Obtain replacement hardware (same model recommended)
- Install matching RouterOS version
- Restore from binary backup:
/system backup load name=latest-backup password=YourPassword
- Update device-specific settings if hardware differs
- Verify all functionality
RouterOS Corruption
Section titled âRouterOS Corruptionâ- Boot from Netinstall if necessary
- Install clean RouterOS
- Restore configuration:
/system backup load name=pre-corruption-backup
Partial Configuration Loss
Section titled âPartial Configuration Lossâ- Identify affected sections
- Import selective exports:
/import file-name=firewall-backup.rsc/import file-name=routing-backup.rsc
Cross-Platform Migration
Section titled âCross-Platform MigrationâWhen moving to different hardware:
- Export configuration from old device:
/export file=migration-config compact show-sensitive=no
- Review and edit .rsc file for hardware differences
- Import to new device:
/import file-name=migration-config.rsc verbose=yes
- Reconfigure device-specific settings
Security Best Practices
Section titled âSecurity Best PracticesâBackup Encryption
Section titled âBackup EncryptionâAlways encrypt backups containing sensitive data:
# Use strong, unique passwords/system backup save name=secure-backup password=ComplexPassword123!@#
# Verify encryption/file print detail where name~"backup"Secure Storage
Section titled âSecure Storageâ- Local storage: Store on secure, encrypted media
- Network storage: Use encrypted protocols (SFTP, not FTP)
- Cloud storage: Use MikroTik Cloud or encrypted third-party services
- Physical security: Protect backup media from unauthorized access
Access Control
Section titled âAccess Controlâ# Limit backup access to specific users/user group add name=backup-admins policy=read,write,policy,test,password,sniff,sensitive,romon
# Create dedicated backup user/user add name=backup-user group=backup-admins password=BackupUserPasswordBackup Verification
Section titled âBackup VerificationâRegularly test backup integrity:
# Test restore on lab device/system backup load name=test-backup password=TestPassword
# Verify export syntax/import file-name=test-export.rsc dry-run=yes verbose=yesTroubleshooting
Section titled âTroubleshootingââBackup file is corruptedâ
Section titled ââBackup file is corruptedââCauses:
- Interrupted backup process
- Storage media failure
- File transfer corruption
Solutions:
- Recreate backup from source device
- Use file integrity checking during transfers
- Maintain multiple backup copies
âCannot restore backup - version mismatchâ
Section titled ââCannot restore backup - version mismatchââCauses:
- RouterOS version incompatibility
- Hardware platform differences
Solutions:
- Upgrade/downgrade RouterOS to match backup version
- Use text export instead of binary backup
- Manually recreate configuration on target version
âImport failed - command not foundâ
Section titled ââImport failed - command not foundââCauses:
- Missing RouterOS packages
- Version-specific command differences
- Syntax errors in .rsc file
Solutions:
- Install required packages before import
- Edit .rsc file to remove incompatible commands
- Use verbose import to identify specific failures
âLost access after restoreâ
Section titled ââLost access after restoreââCauses:
- IP address conflicts
- Firewall rule blocking access
- Interface configuration mismatch
Solutions:
- Connect via serial console
- Reset to defaults and restore incrementally
- Use safe mode during restoration testing
Backup Validation Checklist
Section titled âBackup Validation ChecklistâPre-Backup Verification
Section titled âPre-Backup Verificationâ- Router is stable and fully configured
- All services are operational
- No pending configuration changes
- Sufficient storage space available
Post-Backup Verification
Section titled âPost-Backup Verificationâ- Backup file created successfully
- File size is reasonable (not 0 bytes)
- Backup is encrypted (if password provided)
- Backup stored in secure location
Restoration Testing
Section titled âRestoration Testingâ- Test restore on lab device
- Verify all interfaces come up
- Check routing and connectivity
- Validate service functionality
- Confirm security policies active
Common Configurations Reference
Section titled âCommon Configurations ReferenceâBasic Backup Script
Section titled âBasic Backup Scriptâ/system script add name=create-backup source={ :local backupname ("backup-" . [/system identity get name] . "-" . [/system clock get date]) /system backup save name=$backupname password=YourSecurePassword :log info ("Backup created: " . $backupname)}Scheduled Export
Section titled âScheduled Exportâ/system script add name=weekly-export source={ :local exportname ("export-" . [/system clock get date]) /export file=$exportname compact show-sensitive=no :log info ("Export created: " . $exportname)}/system scheduler add name=weekly-export-schedule start-time=03:00:00 interval=7d on-event=weekly-exportEmergency Reset Script
Section titled âEmergency Reset Scriptâ/system script add name=emergency-reset source={ :log warning "Emergency reset initiated" /system backup save name=emergency-backup password=EmergencyPassword :delay 5s /system reset-configuration skip-backup=yes}Related Topics
Section titled âRelated TopicsâBefore Making Changes
Section titled âBefore Making Changesâ- User Management - ensure proper access
- IP Address Configuration - document current addressing
Automation
Section titled âAutomationâ- Scheduler - automate regular backups
- Email Tool - email backup notifications
Related System Topics
Section titled âRelated System Topicsâ- RouterOS Package Installation - backup before upgrades
- Reset Configuration - restore to defaults
- Logging - track backup operations