MikroTik RouterOS Export and Import

Document revision 26-Mar-2002
This document applies to MikroTik RouterOS v2.4 and v2.5

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 (or part of it) from a text file.

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

[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
[MikroTik] ip address>

To make an export file use the following command:
[MikroTik] ip address> export file=address
[MikroTik] ip address>

To make an export file from only one item use the following command:
[MikroTik] ip address> export file=address1 from=1
[MikroTik] ip address>

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

[MikroTik] file> print
  # NAME                           TYPE    SIZE       CREATION-TIME                
  0 address1.script                unknown 128        mar/26/2002 16:00:13
  1 address.script                 unknown 354        mar/26/2002 15:48:57
[MikroTik] file>

To export the setting on the display use the same command but without the 'file' argument:

[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 
[MikroTik] ip address>

To load the saved export file use the following command:

[MikroTik] > import
file-name: address1.script
[MikroTik] >


© Copyright 1999-2002, MikroTik