The command can be executed from any menu level. Running /export from the root menu ( / ) exports the entire configuration, while running it from a sub-menu, like /ip firewall , exports only that section and its contents.
This creates a .rsc (RouterOS Script) file in the router's Files menu.
/export
Backing up your MikroTik router configuration is essential for disaster recovery, auditing, and hardware migration. While MikroTik RouterOS offers a standard .backup binary file, the export command generates a plain-text script of CLI commands. This readable format allows you to view, edit, and apply your configurations across different MikroTik devices. Why Use MikroTik Export Instead of Backup? mikrotik export configuration
Running an import adds configuration. To restore a complete device, first reset the device to defaults:
This command dumps the entire configuration (excluding default or hardware-specific settings) to the terminal screen. For a router with a complex configuration, this can be thousands of lines long. To make it useful, you typically want to save it to a file.
This happens because you forgot show-sensitive . The restored router will have an empty password for that user. Always use show-sensitive when exporting for a migration; otherwise, keep it hidden for security. The command can be executed from any menu level
In the world of network administration, few tasks are as fundamental—or as critical—as managing device configurations. For MikroTik engineers, the export command is the Swiss Army knife of configuration management. Whether you are backing up a live router, migrating settings to new hardware, documenting a complex setup, or troubleshooting a misbehaving firewall rule, understanding the nuances of mikrotik export configuration is essential.
/export file=backup-$(/system clock get date)
You can also set up a script directly on your MikroTik router to handle the backup process internally. This can be done using the built-in scheduler to run a script at defined intervals. /export Backing up your MikroTik router configuration is
You can export specific configuration sections using the /export command with the section parameter. For example:
You can navigate to a specific menu and run the export command to only get that section. /ip firewall export file=firewall_rules Use code with caution. Export only Wireless Settings: /interface wireless export file=wireless_config Use code with caution. Export DHCP Server Settings: /ip dhcp-server export file=dhcp_config Use code with caution. Using Compact Export
To export the entire configuration to a text file stored on the router’s filesystem:
| Parameter | Description | | :--- | :--- | | file | Saves the export output to a specified .rsc file. If omitted, the export is printed to the terminal. | | compact | Exports only the user-modified configuration lines, omitting RouterOS defaults. This is the default behavior. | | verbose | Exports the complete configuration, including all parameters and items that are set to their default values. | | hide-sensitive | Masks sensitive information like passwords and keys in the output (default behavior in RouterOS v7). | | show-sensitive | Includes sensitive information like passwords and keys in the export file (RouterOS v7 only). | | terse | Outputs the configuration as full commands on separate lines, each including the corresponding menu path. | | path | Allows you to include or exclude specific configuration menus, for example /export path=/ip/firewall,!/ip/firewall/nat . |
Once you have your .rsc file, you can move it to another router (via drag-and-drop in the File menu) and import it. Manual Import Upload the .rsc file to the new router. Open the Terminal. /import file-name=filename.rsc Use code with caution. Automated Import (On Boot/Reset)