HAP AC2 Backup Restore doesn't work

Hello,

I’ve got two HAP AC2s. I’ve upgraded them on the same version of RouterOS (v 6.47). I have one of the routers running with quite a bit of custom configuration (VLANs and stuff). I’m trying to create the same (verbatim) configuration on the second HAP AC2 but I can’t seem to find an easy way without having to recreate everything by hand again. I’ve tried Backup from my first router and Restore on the second and also exported the script in the .rsc format and ran the commands via terminal. No success.

Is there a better way to backup complete configurations and recreate them on the same hardware without having it do it by hand?

Thanks in advance!
ZeeKay

Restore of a backup made on one machine on another machine is a bad idea, you should do a reset to defaults before proceeding any further.
Importing of an export is OK (unless there are statically configured MAC addresses somewhere, so always read the export before importing it somewhere else).
However, there are a few points you need to do/know to succeed:

  1. as the first line of the .rsc file exported from the source machine, put
    delay 1m
    before importing it. The reason is that when the router imports a .rsc file right after reboot, the import starts too early (at least it was the case when I’ve tried last time somewhere around 6.45.7), so some interfaces are not detected yet, and a command attempting to configure a nonexistent interface fails. And execution of any script fails on the first failed command.
  2. some of the commands in the .rsc file are adding items, and add fails if the item already exists. So you have to use a special way:
    /system reset-configuration keep-users=yes no-defaults=yes run-after-reset=the-modified-rsc-file.rsc
  3. as we talk about hAP ac² here, when uploading the .rsc file, it must be placed to the flash directory, and flash/ must be used as a prefix of the file name in the above command (run-after-reset=flash/the-modified-rsc-file.rsc). The reason is that the “root” directory is on ramdisk which gets wiped by reboot, and /system reset-configuration involves a reboot.

Certificates are a separate story, but it doesn’t seem to be relevant to your use case, so it is just a warning for anyone googling this up in future.

I find it easiest to do with RSC files.

But you can copy a backup onto a new unit… You have to reset the MACs afterwords.

Based on the other thread you would be best to reset both to defaults and start fresh. Your router setup needed significant attention and then would be portable to your friends router.
As stated, many prefer (including myself) simply copying and pasting the .RSC file bits and pieces into the new router by use of the terminal command, one section at a time.
Use of safe mode is recommended!!

Thanks for replying to my questions. But is there a way to completely clone one router’s config on to another provided they are similar models? I’d invest time in configuring one router meticulously, then later I just want to clone the same setup. This will come in handy if my current device needs to be replaced or I need to wipe it and quickly get it going. Sounds like there is no such option.

And RSC file does not recreate everything. I find it useful as a reference to copy-paste commands from. But it is very time consuming and if I lose my router’s config then it’ll take me too long to get back online.

Thanks in advance!

Question-1: Why is it a bad idea to clone config of one device on to others? I’m not a router expert. But I do this with all my Linux machines and it works flawlessly.

Question-2: Thanks for the tips in using RSC file. Will I be able to restore my router to my configuration in the RSC file completely by following these steps? Are there any exceptions? I’ve noted your hard coded MAC address exception.

Thanks in advance!

I tried with both methods and it didn’t work with me. Perhaps the “delay 1m’ is useful as some interfaces might not have been initialized as Sindy said above.
Can you outline exact steps to properly do a backup/restore? I followed steps from one of YouTube videos and it doesn’t recreate everything for me.

It should be possbile to transfer binary backup file between two devices of exactly same type, e.g. between two RBD52G’s. Create backup by running

/system backup save name=<name your backup>  # optionally add password=<yourpass>

This will create file .backup under root of file storage (note that on units with small flash, this will be in RAM disk so it will get wiped at reboot).

Transfer the backup file to the new device (using file transfer under GUI or scp if using CLI) and restore it there using

/system backup load name=<name your backup>  # optionally add password=<yourpass>

After that, the new device should have cloned configuration, including interface MAC addresses … which means those should definitely not be active in the same network at any time. As @gotsprings already mentioned, it is advisable to reset MAC addresses to the unit’s native addresses … it can be done using command

/interface ethernet reset-mac-address ether1

(and similarly for the rest of ethernet interfaces).

There is no similar command for wireless interfaces, so it’s highly advisable to make note of original MAC addresses (one per wireless interface, RBD52G will have two). They can be set to original values after backup is applied running

/interface wireless
set [ find default-name=wlan1 ] mac-address=<WLAN1_MAC_address>

(and similarly for the rest of wlan interfaces).

The second command looks exactly the same as the first one. It says “save”. Shouldn’t there be something else there instead?

Thanks for chiming in!

Right you are. It should be “load” … I’ve edited my previous post accordingly.

@mkx, are you bullet-proof that the MAC addresses are the only thing to get affected if you load a backup from one machine on another one of exactly the same type?

Well, I can imagine there are a few reasons why transfering config using binary backup may fail … but if transfering config succeeds in sense that the “clone” device boots, I don’t think there are many things which really get broken.[] Or am I mistaken?


[
] Even cloning MAC addresses is not really broken config, but it might cause problems in certain situations because MAC addresses are not unique any more.

I was thinking about the same thing, that is, MAC addresses. So lets say I follow the method you’ve highlighted, then I’ve to log into the new router and manually change the MAC addresses of each ethernet and wireless interface. But for me to do that, I should have to wipe it clean first and login to make a note of the original MAC addresses on the new device.

I have two questions:

  • If I do not adjust the MAC addresses and assuming that the second router will not be running on my network at all, will the cloned router actually work?
  • What’s the worst thing that can happen if I don’t adjust MACs, if the routers are not even in the same house?

Thanks in advance!

Personally, I can’t vouch that cloned device will work flawless …

If devices won’t ever be part of same L2 network, then using cloned MAC addresses should be fine. Note that L2 network is not only LAN, it can be ISP network as well … which makes associated problems a tad more probable. What kind of problems you might have if ISP doesn’t like seeing two devices with same MAC address … really depends on ISP’s topology and setup. But I’d expect that things will break for both devices.