proper way to restore configs in routeros

goodcooper

[H]F Junkie
Joined
Nov 4, 2005
Messages
9,772
So i've been working on this project, got a config i've been editing for different routers, and it seems like 75% of the time the restore fails... (reboots to no activity on all ports, have to reset and access via layer 2)

i allow the default config to go through, then i upload my script and issue the command:

/system reset-config keep-users=no no-defaults=yes skip-backup=yes run-after-reset=config.rsc


i was thinking the failures i was experiencing were relating to the OS versions on the different devices (all RB2011il, but bought at different times)

is that the case? i noticed if i restored from a binary backup it would work.... but then i had to go manually change all the configuration, super tedious...


so i'm just assuming i'm going about this process all wrong...

tips?
 

NickOlsen8390

Weaksauce
Joined
Sep 24, 2009
Messages
126
Sounds like something is wrong with the config, If it's rebooting to no connectivity. I'd remove any reference to MAC addresses you might have. So that it doesn't try to replace the MAC on the interface or bridge (You could run in to duplicates if it doesn't regenerate them correctly).

When I restore a router (I do many of them.. WISP), I just copy paste parts of it by hand into terminal. Obviously skipping the parts that are going to disconnect me. Like bridge configurations..etc. And never seem to have any issues. But I've never tried restoring via file like you are. I'd be willing to test it for you tomorrow if you wanted to give me some more specifics.

Such as, Just export the config of a working router in place. Then try to restore it. With no changes.

I'd stay away from the binary "Backup button" backup. It doesn't work well if you start jumping hardware type (RB2011 to RB951 for instance).
 

/usr/home

Supreme [H]ardness
Joined
Mar 18, 2008
Messages
6,164
I've had this issue. You need to remove any MAC address reference in the configuration. I do exports then it doesn't save MAC addresses. They are also plaintext and can be manually edited if there are problems. ONLY restore the rsc file to the exact router it came from.
 

goodcooper

[H]F Junkie
Joined
Nov 4, 2005
Messages
9,772
i'll have to give this a try...


so that's my question.... so if you're only supposed to restore the rsc file to the exact router it came from, how am i supposed to easily configure like.... 10 different routers that (all the same model) bought at different times... that generally have identical configs save for IP addresses, hostnames, small stuff like that...

is there another mikrotik tool i should be using?
 

NickOlsen8390

Weaksauce
Joined
Sep 24, 2009
Messages
126
Exporting the backup to file creates a .rsc file. That can be opened with a text editor.

/export file=backup

Will create a file local on the router called backup.rsc

Now. Not to be confused with the binary backup. That can be done with /system backup name=backup. Creates a file called "backup.backup" Or by clicking the "Backup" button in the files window.

The .rsc CAN be restored to other hardware. But I always copy paste section by section.

the .backup binary file CAN also be restored to other devices. But it breaks 9-10 times. So I highly discourage it.

Further more, You surly can have a template that can be applied to "like" routers. We have such templates for routers of our own. That we deploy thousands of. You just have to sanitize the config first, Removing everything but the meat of the config. Remove MAC's...etc.
 

goodcooper

[H]F Junkie
Joined
Nov 4, 2005
Messages
9,772
Exporting the backup to file creates a .rsc file. That can be opened with a text editor.

/export file=backup

Will create a file local on the router called backup.rsc

Now. Not to be confused with the binary backup. That can be done with /system backup name=backup. Creates a file called "backup.backup" Or by clicking the "Backup" button in the files window.

The .rsc CAN be restored to other hardware. But I always copy paste section by section.

the .backup binary file CAN also be restored to other devices. But it breaks 9-10 times. So I highly discourage it.

Further more, You surly can have a template that can be applied to "like" routers. We have such templates for routers of our own. That we deploy thousands of. You just have to sanitize the config first, Removing everything but the meat of the config. Remove MAC's...etc.
ok, i guess i've got it right then...


what about software versions, does it matter what version the software on the router is at when i'm restoring configs from older or newer versions?
 

/usr/home

Supreme [H]ardness
Joined
Mar 18, 2008
Messages
6,164
ok, i guess i've got it right then...


what about software versions, does it matter what version the software on the router is at when i'm restoring configs from older or newer versions?
Not really, unless you are using a feature that was put into a later version and you are using it but the older version doesn't have it. I'm guessing it would just error on that command though.
 

NickOlsen8390

Weaksauce
Joined
Sep 24, 2009
Messages
126
Not really, unless you are using a feature that was put into a later version and you are using it but the older version doesn't have it. I'm guessing it would just error on that command though.

Correct, If your using a feature the current router doesn't support for any reason, Package not enabled. Feature only available in later builds..etc. It'll just throw an error and continue with the import.

Now, If you open the .rsc files. In recent builds (>5.xish) they started only exporting changes. Where previous builds would export everything. So starting from a default config before import is encouraged.
 

goodcooper

[H]F Junkie
Joined
Nov 4, 2005
Messages
9,772
Correct, If your using a feature the current router doesn't support for any reason, Package not enabled. Feature only available in later builds..etc. It'll just throw an error and continue with the import.

Now, If you open the .rsc files. In recent builds (>5.xish) they started only exporting changes. Where previous builds would export everything. So starting from a default config before import is encouraged.
yea, i'm noticing that, which is sort of a problem...

if i restore from no config, it will not work at all... i must restore from the default config, which is fine, besides the fact that i'm changing some IPs in some places and so it errors out unless i delete some things first

it's crazy that there isn't a more elegant way of doing this....

i love how with the edgerouter, the vyatta method, i can just dump a config that's in a certain nested format, has the entire thing in it, and i can just use a text editor to edit the things to my liking, and then just upload it and it will work... this copying and pasting and watching out for overwriting errors and etc, is just such a pain...
 

NickOlsen8390

Weaksauce
Joined
Sep 24, 2009
Messages
126
yea, i'm noticing that, which is sort of a problem...

if i restore from no config, it will not work at all... i must restore from the default config, which is fine, besides the fact that i'm changing some IPs in some places and so it errors out unless i delete some things first

it's crazy that there isn't a more elegant way of doing this....

i love how with the edgerouter, the vyatta method, i can just dump a config that's in a certain nested format, has the entire thing in it, and i can just use a text editor to edit the things to my liking, and then just upload it and it will work... this copying and pasting and watching out for overwriting errors and etc, is just such a pain...

I'm surprised your having such a problem with it. Maybe I've just learned the ways over the years but I don't ever seem to have any issues. Maybe you can provide me a copy of the config you are trying to restore (Sensitive info redacted of course). I reload some pretty lengthy configs regularly..
 
Top