Mikrotik Configuration Management.

Configuration Backup can be used to save MikroTik RouterOS configuration to a binary file, which can be stored on the router or downloaded from it using FTP for future use.
The configuration restore can be used for restoring the router’s configuration, exactly as it was at the backup creation moment, from a backup file.

The restoration procedure assumes the configuration is restored on the same router, where the backup file was originally created, so it will create partially broken configuration if the hardware has been changed.

Configuration Export can be used for dumping out complete or partial MikroTik RouterOS configuration to the console screen or to a text file, which can be downloaded from the router using FTP protocol.

The configuration dumped is actually a batch of commands that add (without removing the existing configuration) the selected configuration to a router.

System Backup

/system backup

The backup save command is used to store the entire router configuration in a backup file. The file is shown in the /file submenu and can be downloaded via FTP to keep it as a backup for configuration and contains sensitive information.

To restore the system configuration, after a /system reset-configuration, it is possible to upload that file via ftp and load that backup file using load command /system backup submenu.
Available Options and/or Parameters:
load name=[filename] – Load configuration backup from a File.
save name=[filename] – Save configuration backup to a File.

Export Configuration


The export command prints a script that can be used to restore configuration. The command can be invoked at any menu level, and it acts for that menu level and all menu levels below it. The output can be saved into a file, available for download using FTP.
Available Options and/or Parameters:
file=[filename] – saves the export to a File.

Compact Export
Starting from v5.12 compact export was added. It allows to export only part of configuration that is not default RouterOS config.

/export compact

Note: Starting from v6rc1 “export compact” is default behavior. To do old style export use export verbose.
Compact export introduces another feature that indicates which part of config is default on RouterOS and cannot be deleted. As in example below ‘*’ indicates that this OSPF instance is part of default configuration.

Import Configuration


The root level command /import [file_name] executes a script, stored in the specified file adds the configuration from the specified file to the existing setup. This file may contain any console commands, including scripts and is used to restore configuration or part of it after a /system reset event or anything that causes configuration data loss.
Note: It is impossible to import the whole router configuration using this feature. It can only be used to import a part of configuration.
file=[filename] – loads the exported configuration from a file to router.

Automatic Import
Since RouterOS v3rc it is possible to automatically execute scripts named with suffix (extension) .auto.rsc. Once this file is uploaded with FTP to the router, it will automatically be executed, just like with the /import command.

Configuration Reset

/system reset-configuration

The command clears all configuration of the router and sets it to the default including the login name and password, IP addresses and other configuration is erased, interfaces will become disabled. After the reset command router will reboot.
If the device has been installed using netinstall and had a script specified as the initial configuration, the reset command executes this script after purging the configuration.
Available Options and/or Parameters:
keep-users – keeps router users and passwords.
no-defaults – doesn’t load any default cofigurations, just clears everything.
skip-backup – automatic backup is not created before reset, when yes is specified.
run-after-reset – specify export file name to run after reset.

Comments are closed.