Export and Import

Document revision 16-Sep-2002
This document applies to MikroTik RouterOS v2.6

The configuration export can be used for dumping out MikroTik RouterOS configuration to the console screen or to a text (script) file, which can be downloaded from the router using ftp. The configuration import can be used to import the router configuration script from a text file.

Note that it is impossible to import the hole 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.

Topics covered in this manual:

Installation

The Export and Import features are included in the 'system' package. No installation is needed for this feature

Hardware Resource Usage

There is no significant resource usage.

Export and Import Description

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. The 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.

Export and Import Examples

[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 use the following command:

[admin@MikroTik] ip address> export file=address
[admin@MikroTik] ip address>

To make an export file from only one item use the following command:

[admin@MikroTik] ip address> export file=address1 from=1
[admin@MikroTik] ip address>

To see the files stored on the router use the following command:

[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>

To load the saved export file use the following command:

[admin@MikroTik] > import
file-name: address1.rsc
[admin@MikroTik] >


© Copyright 1999-2002, MikroTik