Export and Import

Document revision 1.1 (31-Jan-2003)
This document applies to MikroTik RouterOS v2.7

Table of Contents

Summary

Configuration export feature is used to dump the part or whole RouterOS configuation. Then it can be edited and imported to the same or to an another router.

Specifications

Packages required : system
License required : Any
Home menu level : /
Protocols utilized : None
Hardware usage: not significant

Related Documents

Software Package Installation and Upgrading
IP Addresses and Address Resolution Protocol (ARP)
Configuration Backup and Restore

Description

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.

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.

The Export Command

Command name : export

Example

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

The Import Command

Command name : /import

Example

To load the saved export file use the following command:
[admin@MikroTik] > import address1.rsc
[admin@MikroTik] >

© Copyright 1999-2003, MikroTik