Router migration with backup

Report problems and success stories with Gargoyle on various hardware platforms.

Moderator: Moderators

Post Reply
stuartbh
Posts: 76
Joined: Sun Oct 20, 2019 4:18 pm

Router migration with backup

Post by stuartbh »

Gargoylers,

I installed Gargoyle 1.11.0 onto a Netgear WNDR3700v2 a while ago and have steadily gotten it working quite well. Now, I recently obtained a Linksys WRT1900AC (which also now has Gargoyle 1.11.0 installed upon it), and I wish to migrate my configuration from the Netgear to the Linksys.

Of course my first step was to take a backup of the Netgear configuration and save it to my laptop. However, I would imagine there are certain things I'd want to change before I restore it to the new router (for example, the router hostname), amongst other things too (none else come to mind instantly, but I am sure there are some).

The Netgear had a number of plugins added, would I need to add them to the Linksys before I did the restore of the configuration or after restoring the configuration? Or would restoring the configuration also restore the plugins?

DHCP (30 to 35 static IPs) would be the biggest thing I do not wish to recreate, but OpenVPN configuration, SSH keys, etc... are all other things I do not wish to regenerate either.

Any suggestions and comments would be well appreciated!


Stuart, N3GWG
Computer Scientist
Very Respectfully,

Stuart, N3GWG
Computer Scientist

Lantis
Moderator
Posts: 6751
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Router migration with backup

Post by Lantis »

You cannot restore a backup between two different devices. You will soft-brick your device and require a failsafe reset.

If you don't want to restore all settings by hand, you can attempt to restore the files individually using something like WinSCP.
You should reboot the router after these changes to get them applied in general.
Do not restore the network, system or wireless config files.

Yes plugins would need to be loaded first.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

stuartbh
Posts: 76
Joined: Sun Oct 20, 2019 4:18 pm

Re: Router migration with backup

Post by stuartbh »

Lantis wrote:You cannot restore a backup between two different devices. You will soft-brick your device and require a failsafe reset.

If you don't want to restore all settings by hand, you can attempt to restore the files individually using something like WinSCP.
You should reboot the router after these changes to get them applied in general.
Do not restore the network, system or wireless config files.

Yes plugins would need to be loaded first.
So, I have learned some several things between the time I posted my message and just now (whence I read your reply).

First, I already tried it before I posted the original message, soft-bricked the device and recovered. Thereafter, some granular study of the backup tar stood indicative of the fact that there were binary files in that tar, which surely cannot be moved over between architectures!

This command was able to identify which files were ASCII and even worthy of any evaluation whatsoever:

find . -type f -exec file {} \; | grep -v 'data' | cut -d: -f1

I then realized that in the /etc/config/system maybe the 'ntp' section and may the 'system' section could be recycled, but the rest were specific to the device's LEDs and such. With only the hostname and time settings in the system file being of any significance to convert, it is easy to simply reset these settings later and forgo moving any part of /etc/config/system.


With respect to the /etc/config/wireless file there are two sections, the wifi-device section and the wifi-iface section. The wifi-device section cannot be copied as the path and other specifics will likely be different. However, the wifi-iface section (keeping the radio0 or radio1 or what have you in those sections in mind) might be able to be salvaged and appended to a clean /etc/config/wireless.

/etc/config/network - seems useless to try to port the old one at all given it is very hardware specific.

It really does seem as though the main files that are really able to be moved over are the ethers, hosts, and maybe dhcp file (mine has option 150 added, which I do not think can be done via the GUI, can it?).

My thinking is to reset the new router, add the plugins, configure everything I want, openVPN, etc..., and then when I am entirely done, back it up, untar the backup, update the ethers, hosts file, dhcp file and retar the backup, restore it, and go on my merry way.

What say you on this?
Very Respectfully,

Stuart, N3GWG
Computer Scientist

Lantis
Moderator
Posts: 6751
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Router migration with backup

Post by Lantis »

Yes everything you've said is correct.
I'll clarify that the binary files in /usr/data should be safe, as they are written in the same memory pattern every time (regardless of system endianness) as far as my understanding of the code. However there is still potential for that to go wrong.

Yes your method sounds fine to me.
You can probably rescue the contents of /etc/openvpn (i think it gets backed up as part of the tar...) and reuse this as well if you don't want to regenerate your Openvpn config.
This goes hand in hand with the gargoyle_openvpn config file and possibly the regular openvpn config file.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Post Reply