Community discussions

MikroTik App
 
dreweinhorn
newbie
Topic Author
Posts: 28
Joined: Thu Mar 26, 2009 5:34 pm

Backup/Restore vs. Export/Import

Mon Jul 20, 2009 6:40 pm

My first impression on reading the
included some misconceptions.

I looked at backup/restore and saw that it saves everything
in one big binary file. You cannot make any adjustments
before you restore.

Export/Import seemed much better.
It saves everything in a editable text file.
Once I get things working on a test router,
I can save the configuration to a text file,
edit the configuration, tweaking names,
ip numbers, etc. Copy the file to a production
router, tweak names and numbers, copy
to another production router.

Bzzzt. Wrong!

excerpt from the documentation in

http://www.mikrotik.com/testdocs/ros/3. ... config.php

Importing Configuration
Command name: /import

...

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.

It took a bunch of work to get my exported configuration into a form that is importable.

Maybe I did things the hard way.
Is there an easy way?
 
eneimi
Member
Member
Posts: 387
Joined: Sun Sep 09, 2007 12:55 pm

Re: Backup/Restore vs. Export/Import

Mon Jul 20, 2009 7:20 pm

When migrating from RB to another RB, that means new interfaces, new mac-addresses, new board, new firmware, new ROS version probably etc.

Like you noticed, list of firewall rules etc should go seamlessly, else, you'll always have to do some editing.
 
dreweinhorn
newbie
Topic Author
Posts: 28
Joined: Thu Mar 26, 2009 5:34 pm

Re: Backup/Restore vs. Export/Import

Mon Jul 20, 2009 8:03 pm

After exporting a configuration,

and editing it to make another configuration for this bpx, or another box.

Is the an easy way to make it "importable",

getting around the nasty gotcha in the /import documentation?
 
eneimi
Member
Member
Posts: 387
Joined: Sun Sep 09, 2007 12:55 pm

Re: Backup/Restore vs. Export/Import

Tue Jul 21, 2009 12:19 am

You shouldn't have to edit anything.

I export and import firewall rules, hotspot data etc without any editing.

What exactly did you have to remove or add to the exported file before importing?
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Backup/Restore vs. Export/Import

Wed Jul 22, 2009 3:42 pm

if you just use /export file=<the file> it will export all the settings, including defaults. edit out all the unnecessary stuff and you are good to go.

on the other hand you can go into submenu and save specific settings like - /ip address export
 
User avatar
desoto
newbie
Posts: 28
Joined: Fri Apr 24, 2009 12:27 pm

Re: Backup/Restore vs. Export/Import

Thu Jul 23, 2009 8:25 pm

The first think I do is backup the system. Then open a terminal window and type in export file=backupfilename and press enter. Then I ftp into the unit download the rsc file to my computer using editor make changes and then ftp it back to a new unit and run the script.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26964
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia
Contact:

Re: Backup/Restore vs. Export/Import

Fri Jul 24, 2009 3:34 pm

the "import" command simply and blindly executes any commands that are in the given file. ANY commands. this means that you can write your own commands in there, just like you would configure a new router. Then import this file into any number of routers.

That comment in the manual simply implies that a "/export file=" file will not always work on another system, you will have to edit it and tweak it. But as I said, you don't need to export anything to be able to import. Just make a new file, and write commands that you will need.