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. If the argument from is used, then it is possible to export only specified items. In this case export does not descend recursively through the command hierarchy. export also has the argument file, which allows you to save the script in a file on the router to retrieve it later via ftp.
The root level command /import file_name restores the exported information from the specified file. This is used to restore configuration or part of it after a /system reset event or anything that causes configuration data loss.
Note that it is impossible to import the whole router configuration using this feature. It can only be used to import a part of configuration (for example, firewall rules) in order to spare you some typing.
For backing up configuration to a binary file and restoring it without alterations, please refer to the configuration backup and restore section of the MikroTik RouterOS Manual.
[admin@MikroTik] ip address> print Flags: X - disabled, I - invalid, D - dynamic # ADDRESS NETWORK BROADCAST INTERFACE 0 10.5.5.244/24 10.5.5.244 10.5.5.255 ether1 1 10.5.5.245/32 10.5.5.245 10.5.5.245 ether1 2 10.5.5.246/32 10.5.5.246 10.5.5.246 ether1 [admin@MikroTik] ip address>To make an export file:
[admin@MikroTik] ip address> export file=address [admin@MikroTik] ip address>To make an export file from only one item:
[admin@MikroTik] ip address> export file=address1 from=1 [admin@MikroTik] ip address>To see the files stored on the router:
[admin@MikroTik] > file print # NAME TYPE SIZE CREATION-TIME 0 address1.rsc script 128 mar/26/2002 16:00:13 1 address.rsc script 354 mar/26/2002 15:48:57 [admin@MikroTik] file>To export the setting on the display use the same command but without the file argument:
[admin@MikroTik] ip address> export from=0,2 / ip address add address=10.5.5.244/24 network=10.5.5.244 broadcast=10.5.5.255 interface=ether1 comment="" disabled=no add address=10.5.5.246/32 network=10.5.5.246 broadcast=10.5.5.246 interface=ether1 comment="" disabled=no [admin@MikroTik] ip address>
[admin@MikroTik] > import address1.rsc [admin@MikroTik] >