Posted: Thu Jan 05, 2012 20:32 Post subject: Just wondering how long it takes for others ...
How long does it take for your script to run? I'm running DD-WRT v24-sp2 (12/18/09) std (SVN revision 13491M VINT Eko) on an old WRT54G/GL/GS and it took nearly five minutes to run.
Joined: 24 Feb 2009 Posts: 2026 Location: Sol System > Earth > USA > Arkansas
Posted: Fri Jan 06, 2012 1:35 Post subject: Re: Just wondering how long it takes for others ...
skanky wrote:
Is this typical?
Yes. The script reads the entire nvram to a file and then parses the file into appropriate sections. Even on faster hardware it would still take 2 to 5 minutes. Not exactly fast, but it gets the job done. _________________ E3000 22200M KongVPN K26
WRT600n v1.1 refirb mega 18767 BS K24 NEWD2 [not used]
WRT54G v2 16214 BS K24 [access point]
Try Dropbox for syncing files - get 2.5gb online for free by signing up.
Read! Peacock thread
*PLEASE* upgrade PAST v24SP1 or no support.
Posted: Fri Jan 06, 2012 15:59 Post subject: Re: Just wondering how long it takes for others ...
crashfly wrote:
skanky wrote:
Is this typical?
Yes. The script reads the entire nvram to a file and then parses the file into appropriate sections. Even on faster hardware it would still take 2 to 5 minutes. Not exactly fast, but it gets the job done.
I appreciate it, glad to know I've not done something wrong.
i know the post is kinda old, but i tried the v1.3 and it does not backup any files into the /opt/var/backups, it says it does but does not work. So i could not finialize testing.
Posted: Sun Apr 08, 2012 20:58 Post subject: Complete update across firmware
In case this helps anyone else, here's how I restored all my settings on a PPPoE Asus RT-N16 router across firmware builds - from the R14584 big build of June 2010 to the NewD2 K2.6 R18024 mega build of December 2011.
Since I have two RT-N16s in different locations I thought it was worth spending some time on it, but after playing with iMacros not that much time.
It looked like iMacros would be very labour-intensive, which didn't appeal so I decided to try to use Frater's backup and restore script with some extra work to cover every variable.
Since I'm not changing hardware I though it unlikely that the previous value of settings would conflict with the revised firmware.
I ran backupessential from a PuTTY SSH session and used WinSCP (running under Wine 1.3 in Ubuntu 11.10) to copy all four scripts from the backups directory, as well as 'all_vars' (the complete list of nvram settings) from the tmp directory.
After updating the firmware, I set up SSH (to access the router's command terminal) and jffs on the router as a minimal configuration; re-ran the backupessential script; copied the new backup scripts and all_vars to my pc.
I used BeyondCompare from Scooter Software - it's a powerful and user-friendly tool, available on a trial basis - to compare and merge the two all.sh files (named something like 485B3906348D.04092012.all.sh) to a new restore script which I called merge.sh.
There were about 12-1300 lines in total, and I found around 100 differences.
I spent some time looking at the differences as I wasn't sure what I would find, but in the end it seemed straightforward:
If the nvram setting had the same name but a different value, I took the original value.
If a setting was in the old version but wasn't in the new version, I left it out.
If a setting wasn't in the old version but was in the new version I kept it.
The jffs partition was untouched in the upgrade process but I needed to restore my merged backup file to /jffs/opt/usr/sbin/merge.sh and render it executable:
Code:
chmod +x backupessential.sh
Then I crossed my fingers and ran:
Code:
./merge.sh
After a slight delay the update finished and on going through the web-management screens all my settings had been restored. I edited a couple of new settings, ran an nvram backup from the browser and gave heartfelt thanks to Frater for his tidy script and everyone who contributed to this project.
It's possible that changes in the firmware could cause unforeseen problems and there may be a risk of 'breaking' remote management access or the LAN networking so that the router can't be accessed. In those cases the reset button should act as a get-out-of-jail card by restoring factory defaults.
I hope this helps anyone who's thinking about a backup and restore - having said that YMMV.
And yes, I know this is a Broadcom thread. Should I reopost in the Atheros forum?
Edit: I thought about this for another 15 minutes and am guessing it might work or only partially work due to variations in naming conventions of the vars. _________________ TP-Link TL-WDR4300 v1 (NAS) - r54682
Buffalo WZR-600DHP (Gateway, NAS, DDNS, DHCP) - r54682
Netgear R7800 (Gateway, DDNS, DHCP, DNSMASQ w/Pi Hole) - r54682
Netgear R7800 (AP) - r54682
- ran "backup2.sh" ==> saved the "ALL-Variable.sh" to my PC
- did a RESET on the router
- setup the box to minimum, so that I can get the "backup2.sh" up and running. ==> saved this "NEW" version of the "ALL-Variable.sh" to my PC
- did a DIFF on both and ==> vola, had all the changes I did between a NEW / virgin router and my configured box.
- edited the script to capture just the items I needed (e.g. static leases etc.) and now have a SAVE script to load onto any router I want .... ATTENTION: You really need to know which variables you want to keep and which are SAFE ... it might otherwise brick your box. (e.g. configure a 5Mhz WiFi on a router who does not have it)
Joined: 05 Oct 2008 Posts: 666 Location: Helsinki, Finland / nr. Alkmaar, Netherlands
Posted: Fri Jun 26, 2015 15:05 Post subject:
I've succesfully used the script that's the subject of this thread (in a somewhat edited form) on both Broadcom and Atheros based hardware to restore my settings to a new firmware version.
This week I upgraded my WZR-HP-G300NH to version 27396 and since then the script to store my settings in a backup script stopped working.
This is the error message as given by WinSCP:
Command '"./Backup_DD-WRT_Settings_AR_05022011.sh"'
failed with return code 0 and error message
/dev/nvram: Out of memory
size: 20 bytes (131052 left).
I have never had any problems with this script.
The latest dd-wrt firmware versions have a 3.0 Linux kernel, which is much newer than what the old one had (I have had Buffalo's 19484 installed for a long time). Perhaps the new kernel has something to do with this problem, but I don't really know much about Linux.
My previously mentioned editing of the script must necessarily have been very slight, as I know very little about the script language. I therefore refer to the original script in the Wiki, Scripting, Useful scripts, Backup .... Script used to be known as Frater's script.
(If needed, I can post my own version.)
Who would like to shed some light on this?
The said script has been really - really - helpful for copying one's settings over from one version to another even to different hardware. My version is from 2011 ...