I was wondering if it is possible to backup all of my settings on one MikroTik and then restore then to a different MikroTik so that I don’t have to reprogram everything?
Can you do this with an identical MikroTik? Can you do this with different models of MikroTiks?
You can export compat file a thne import on another device. If you want to use that settings on other model you will have to edit that file and put some changes or delete some lines
From terminal, execute the “/export” command with a “file” argument, copy the file to the other router, and use the “/import” command to apply the settings from the file on it.
Follow up question… does the export and import functions have to be the same model of router to work?
I created an export file from my RB2011 and then tried to import the file into my RB750 this is what I got from the terminal…
expected end of command (line 21 column 26)
They don’t have to be the same model, but the RouterOS version should be more or less the same.
MikroTik tend to add/remove/rename commands/arguments/menus between different versions, and if you use such a thing, it will cause errors like the one you have. They don’t always do that though, so you MIGHT be able to import to a different versions, but equally likely, you MIGHT get the sort of errors that you do.
Upgrade both routers to the same version, and copy the settings afterwards.
Alternatively, you’ll need to actually inspect the file that “/export” generates, and correct all incompatibilities “manually” before doing the “/import”. The error message tells you the command that caused an error.
In more recent RouterOS versions, “export” has two flavors - compact and non-compact.
“compact” should in theory remove all defaults, leaving only modifications after them.
If even that doesn’t work… Yeah, you need to “manually” go over the script. Or you could call “export” on menus individually, forming several files that you then import one by one.
Ran the compact export from my RB2011 and tried to import it into my RB750, still get the same error. I don’t know how to read the script as far as figuring out what (line 21 column 26) is referring to. Do I literally just count down the rows from where the script starts to row 21 and then over 26 characters? Ugh LOL
Yes. Exactly. “Row” means “line” and “column” means “character”.
The error you’re getting is not from defaults. It’s due to version incompatibility. If it was due to defaults being present, the error would’ve been something along the lines of “failure: already exists”.
Errors like “expecting ()” mean what I said above about menus, command and arguments. RouterOS fails as soon as it hits an unknown thing (usually, an argument or an argument value), and it points you to the place where that unknown thing is.
If the two versions are the same, you won’t see errors of this kind.
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
Apparently, your target router does not have a default wireless security profile specified, and thus you can’t modify said profile.
Does the target router not have a Wi-Fi? That’s probably the cause here - your source router has Wi-Fi, but your target one doesn’t. Or maybe you don’t have the “wireless” module… Check the “/system package” menu of both routers.
You are correct, that was that error. Once I fixed that it went to another error and I fixed that as well. I would need to spend some time tweaking the RSC file as it is errors because of the hardware differences between the two different routers I am experimenting with… For example one is a 5 port router and the source file is coming from an 10 port.
So I think if I had identical hardware it would work great…
Why does it not work when I select to restore to factory default and then check the box that says “no default configuration” and then to run the script file does it not work? It seems like this would remove all those pesky default settings that are getting in the way and then drop my script over it…
Buddy,
If you have things configured on port 6-10 on ur RB 2011 how do you expect to find them on RB 750. Also RB 750 has no wireless.
Change those setting and your export import will work good.
I did that with the wireless and got past that error no problem. I also deleted all the ports after port 5 and got rid of that error. Still another new error. No big deal, my main concern is I want to purchase an identical equipment router for a backup at work. I did not have an identical one for testing the export function, only mismatched MikroTiks. I am confident now that it will work just fine if I get identical equipment…
I started to get errors to the effect of “device already has name” or something to that effect… Errors that would not point me in the script file where it needed corrected…