Introduction · Topic 7 of 8

Configuration Backups and Export Files

Learn how to save and restore a RouterOS backup, how a binary backup differs from an export rsc file, and how to edit an export file safely.

  • 5 min
In a nutshell
  • /system backup save creates a binary .backup file, and /system backup load restores it.
  • A backup is meant to be restored on the same device.
  • /export file=name creates a text .rsc file, and /import file-name=name.rsc runs it.

What it is

RouterOS can save its configuration in two different forms, and each has its own use.

A backup is a binary file that captures the whole router state, to be restored on the same device. An export is a plain text script of configuration commands, which you can read, edit and run on any router.

Choose by the job: backup to recover the same router, export to read, review or move a configuration.

Routerrunning configurationsystem backup saveBackup filebinary, same deviceRouterexportExport filersc text scriptimportOther routeredited copy

How it works

You create the file on the router, copy it off the device, and bring it back when you need it.

Saving and restoring a backup

A backup is made with one command, and it is stored in the router file list.

/system backup save name=r1-before-change
/file print
/system backup load name=r1-before-change.backup

The file gets the .backup extension. To restore it, use the load command, and the router restarts to apply the saved state.

Copy the file off the router, because a backup that exists only on the router is lost if the router fails. You can download it from the Files window or over FTP or SSH file transfer.

A backup can be protected with a password when it is saved, so that others cannot restore it. Keep that password safe, because it is needed at restore time.

Exam tip

Take a backup before every risky change, and copy it off the router so that a hardware failure cannot take it away.

Exporting the configuration

An export writes the configuration as text commands.

/export file=r1-config
/ip firewall export
/export verbose file=r1-full

The first command writes the whole configuration to r1-config.rsc. You can also export one menu, as the second command does for the firewall.

Recent versions export only the settings that differ from the defaults, and the verbose option includes the defaults as well, as the third command does. Depending on the version, sensitive values such as passwords may be left out of the file.

To run an export file on a router, copy it to the file list and import it.

/import file-name=r1-config.rsc

The router runs the commands line by line, as if you had typed them.

Backup versus export

QuestionBackup (.backup)Export (.rsc)
FormatBinaryPlain text script
Readable and editableNoYes
Best forRestoring the same routerReviewing, editing, moving to another router
RestoresThe complete stateOnly the commands in the file
Between different modelsRiskySuitable, after editing

A binary backup includes details tied to the device, so it is not meant for a different model. An export is only text, so it is portable, but it contains only configuration. Files that are not configuration are not part of it.

Keep both. A backup gives a fast full restore, and an export gives a readable record that you can compare with later versions.

Editing an export file

An export file is a normal text file, so you can open it in any text editor. This is its great advantage.

Typical edits are:

  • Remove lines that belong only to the old device, such as its identity or hardware specific interfaces.
  • Change interface names, addresses or other values for the new router.
  • Delete sections you do not want to carry over.
  • Add # comment lines to explain parts of the script.

The file runs top to bottom, so keep dependent lines in order. A rule that mentions a bridge or an address list must come after the line that creates it.

Watch out

Import runs every line, so review an edited file carefully and never import one you have not read.

Test an edited file on a spare router or a lab device first. A mistake in an import can change the address you use to manage the router.

What to remember for the exam

Seven facts cover this topic.

  • /system backup save creates a binary .backup file, and /system backup load restores it.
  • A backup is meant to be restored on the same device.
  • /export file=name creates a text .rsc file, and /import file-name=name.rsc runs it.
  • An export is readable and can be edited in a text editor.
  • An export can be taken for one menu, such as the firewall.
  • Copy backup and export files off the router.
  • An import runs the commands line by line, so order matters.

Common mistakes

These four mistakes are common.

Keeping the only backup on the router. If the router fails, the file is gone, so copy it away.

Restoring a backup on a different model. A backup is tied to the device, so use an edited export instead.

Importing an unedited export on another router. Device specific lines can clash, so edit them first.

Putting lines in the wrong order. A line that depends on an earlier object fails if it comes first.

Check yourself

Work through these three questions.

  • What is the main difference between a backup and an export?

    A backup is a binary file meant to restore the same device. An export is a readable text script that you can edit and import on another router.

  • Which commands save and restore a binary backup?

    /system backup save name=... creates the file and /system backup load name=... restores it. The router restarts to apply the state.

  • Why is the order of lines important when you edit an export file?

    The file runs line by line from the top. A line that depends on an object must come after the line that creates it.

Topic 7 of 8 in Introduction

Test yourself on Introduction

The full MikroTik MTCNA question bank has 558 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by MikroTik. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.