Community discussions

MikroTik App
 
hatred
newbie
Topic Author
Posts: 26
Joined: Tue Sep 01, 2015 10:23 pm

hAP ac² - can't import just exported configuration

Fri Mar 29, 2024 2:05 pm

I purchased a hAP ax² and want to transfer the configuration from my main hAP ac² to it.
Currently I have ROS v7.14.2 installed on ac². To check the configuration and possibility of its transfer, first I tried to create the backup and load it back. The .backup file is restored without problems after netinstall. However, the .rsc file that was just made cannot be imported back to the same router. I reset the configuration, reboot the router, upload .rsc file, write a command in the terminal, then several lines flash in the terminal and the connection to the router is lost. When I reconnect, it is clear that it has loaded only a small part of the config, and there are no errors in the terminal.

What am I doing wrong?
Last edited by hatred on Fri Mar 29, 2024 3:28 pm, edited 1 time in total.
 
erlinden
Forum Guru
Forum Guru
Posts: 1975
Joined: Wed Jun 12, 2013 1:59 pm
Location: Netherlands

Re: hAP ac² - can't import just exported configuration

Fri Mar 29, 2024 2:09 pm

Backup is only for restoring on the same device. You might want to reset the ax2.
Transferring through config can be done (is it a complete export?).

Be aware that i.e. the 2.4GHz radio on the ac2 is wifi1, while it is wifi2 on the ax2. And it is in a new menu structure, so better not import it, just set it manually.
 
hatred
newbie
Topic Author
Posts: 26
Joined: Tue Sep 01, 2015 10:23 pm

Re: hAP ac² - can't import just exported configuration

Fri Mar 29, 2024 2:44 pm

Backup is only for restoring on the same device. You might want to reset the ax2.
Transferring through config can be done (is it a complete export?).
I've read the articles and understand the difference between backup and rsc (export). Export was done using the console command:
export file=filename show-sensitive
Also I've tried:
export file=filename show-sensitive verbose
Result is the same.
Be aware that i.e. the 2.4GHz radio on the ac2 is wifi1, while it is wifi2 on the ax2. And it is in a new menu structure, so better not import it, just set it manually.
This is a different question, please note that I’m trying to import the config to the same ac2 with the same ROS & packages from which I just exported it.
 
holvoetn
Forum Guru
Forum Guru
Posts: 5500
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: hAP ac² - can't import just exported configuration

Fri Mar 29, 2024 2:52 pm

You can not simply import an earlier made export since the target device will have some default config present, which then conflicts with some parts you want to import from the earlier made export (still with me ?).

Best to use notepad/notepad++ and import config block by block using copy/paste on terminal, observing what is already present as default.

Be also aware some default settings can change from version to version and only when you perform reset to default config (or netinstall), those new defaults will come into effect.
 
hatred
newbie
Topic Author
Posts: 26
Joined: Tue Sep 01, 2015 10:23 pm

Re: hAP ac² - can't import just exported configuration

Fri Mar 29, 2024 3:25 pm

You can not simply import an earlier made export since the target device will have some default config present, which then conflicts with some parts you want to import from the earlier made export (still with me ?).
I understand this and completely reset the device configuration ("no default" checked) before importing settings.
Best to use notepad/notepad++ and import config block by block using copy/paste on terminal, observing what is already present as default.

Be aware that i.e. the 2.4GHz radio on the ac2 is wifi1, while it is wifi2 on the ax2. And it is in a new menu structure, so better not import it, just set it manually.
How can I figure out what's going wrong in future attempts to import config blocks into ax2 if importing the config to the same ac2 with blank config, with the same ROS & packages fails?
Last edited by hatred on Fri Mar 29, 2024 3:26 pm, edited 1 time in total.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19414
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: hAP ac² - can't import just exported configuration

Fri Mar 29, 2024 3:26 pm

The reasons is that the order of the RSC file, is NOT the order required to add rules to make the config coherent.
In other words, you dont understand the config to the level necessary otherwise you wouldnt have tried, but instead would have
copied and pasted bits in the right order.
 
hatred
newbie
Topic Author
Posts: 26
Joined: Tue Sep 01, 2015 10:23 pm

Re: hAP ac² - can't import just exported configuration

Fri Mar 29, 2024 3:39 pm

The reasons is that the order of the RSC file, is NOT the order required to add rules to make the config coherent.
In other words, you dont understand the config to the level necessary otherwise you wouldnt have tried, but instead would have
copied and pasted bits in the right order.
Okay, I accept my limited understanding of the config file design.
Let's omit why RouterOS produce rsc not in the order required to add rules to make the config coherent.
Is the proper order of config blocks described anywhere?
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3514
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: hAP ac² - can't import just exported configuration

Fri Mar 29, 2024 4:05 pm

It's really not a "config" — it a script file used to setup a router. So when you :export, that more "script generator" & :import similarly just a script runner. Only backup is "full copy" of everything.

As script, the order can be anything you want. Now if a called command references something else, that does need to be defined before using it. e.g. so an interface-list must be created before using it in a firewall rule. But when you an :export RouterOS it should produce correct order, but possible they have a bug.

If you login using MAC/winbox, and do an ":import verbose=yes myconfig.rsc" on no-default router, it will show you the line it fails on.

And over time there have been various bugs where an export is missing some [quasi-default] attribute or the like, and an import will fail since it's needed etc. So if you cannot import the same config back to the same router, at same version, after resetting it to blank... that's a bug.

How can I figure out what's going wrong in future attempts to import config blocks into ax2 if importing the config to the same ac2 with blank config, with the same ROS & packages fails?

Now in terms of transferring config from ac2 to ax2, there is no cookie-cutter way other than modify the original script manually. In terms of what to modify, you need to setup an ax2 with the desired config, and cut-and-paste that into the exported ac2 one for the wi-fi part. Essentially there is no config "migration" tool to adapt it automatically.
 
WeWiNet
Long time Member
Long time Member
Posts: 597
Joined: Thu Sep 27, 2018 4:11 pm

Re: hAP ac² - can't import just exported configuration

Fri Mar 29, 2024 4:24 pm

On hap-ac, default wifi1 is the 2.4Ghz interface, while on hap-ax 2.4Ghz is called wifi2.
Importing therefore a script without changes will either fail, or configure something wrong ...

You will have to sanitize it first a bit.
 
jaclaz
Long time Member
Long time Member
Posts: 670
Joined: Tue Oct 03, 2023 4:21 pm

Re: hAP ac² - can't import just exported configuration

Fri Mar 29, 2024 5:22 pm

See also this:
viewtopic.php?t=205697
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3514
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: hAP ac² - can't import just exported configuration

Fri Mar 29, 2024 5:58 pm

Personally, I think it's better to start with the newer default configuration of hAPax, and use the old config as a guide what to add on the hAPax manually. And compare the two configs after done to see if anything was missed (since they should look similar)

If you add more hAPax, then it should import on same model in future. So it only be a one-time effort on first hAPax.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19414
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: hAP ac² - can't import just exported configuration

Fri Mar 29, 2024 7:07 pm

Comparing is good, why I like notepadd++ as it has a comparitive plugin,,,,,,, comes in handy
 
hatred
newbie
Topic Author
Posts: 26
Joined: Tue Sep 01, 2015 10:23 pm

Re: hAP ac² - can't import just exported configuration

Mon Apr 01, 2024 9:32 pm

Amm0, thanks for the informative answer.

Well, I completely forgot, there are no easy ways in the MikroTik world.

Who is online

Users browsing this forum: cfeilen and 16 guests