Backup settings and restore them to even different hardware.

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3 ... 21, 22, 23, 24  Next
Author Message
Apex-XT
DD-WRT Novice


Joined: 12 Dec 2008
Posts: 23

PostPosted: Tue Jul 05, 2011 15:22    Post subject: Reply with quote
I'm very interested in applying this as a service using the CLI as part of the OTRW setup. Any progress on integrating this into OTRW?

Thank you for the good work.
Sponsor
basmaf
DD-WRT Guru


Joined: 24 Feb 2011
Posts: 1074

PostPosted: Wed Jul 06, 2011 20:47    Post subject: Reply with quote
You can already use it if you want, backup script work exactly the same as backupessential included in OTRW.

Use instructions in this post
http://www.dd-wrt.com/phpBB2/viewtopic.php?p=615958#615958

Use version 1.2
Take note of comments i made about moving your existing backups.
Apex-XT
DD-WRT Novice


Joined: 12 Dec 2008
Posts: 23

PostPosted: Thu Jul 07, 2011 13:04    Post subject: Reply with quote
Thank you!
ghatothkach
DD-WRT Novice


Joined: 03 Jan 2009
Posts: 25

PostPosted: Thu Jul 21, 2011 19:07    Post subject: Reply with quote
hi

Is there a way to run this script automatically from

/jffs/

??

I will probably like to have a local /jffs/ backup, and scp out the backup using another computer.

Ghat
alexandrnew
DD-WRT User


Joined: 21 Oct 2010
Posts: 75

PostPosted: Sat Nov 12, 2011 7:36    Post subject: Reply with quote
basmaf wrote:
Your router is based on an Atheros chip.
Not familiar with those routers but have the feeling that it has limited functions within OS

Seen in the optware script the atheros is not supported probably cause its missing functions. like tee and sort

Check the atheros forum for more info.

I also atheros device.
i not find backup script in atheros forum.
help me please
skanky
DD-WRT Novice


Joined: 27 Nov 2011
Posts: 3

PostPosted: Thu Jan 05, 2012 20:32    Post subject: Just wondering how long it takes for others ... Reply with quote
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.

Is this typical?

Thanks &
Cheers,

Toby
crashfly
DD-WRT Guru


Joined: 24 Feb 2009
Posts: 2026
Location: Sol System > Earth > USA > Arkansas

PostPosted: Fri Jan 06, 2012 1:35    Post subject: Re: Just wondering how long it takes for others ... Reply with quote
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.
skanky
DD-WRT Novice


Joined: 27 Nov 2011
Posts: 3

PostPosted: Fri Jan 06, 2012 15:59    Post subject: Re: Just wondering how long it takes for others ... Reply with quote
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.
rocky13
DD-WRT User


Joined: 25 Apr 2008
Posts: 158

PostPosted: Fri Mar 09, 2012 4:28    Post subject: Reply with quote
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.

v1.2 works for the backup part of it.
basmaf
DD-WRT Guru


Joined: 24 Feb 2011
Posts: 1074

PostPosted: Fri Mar 09, 2012 5:28    Post subject: Reply with quote
Just use version 1.2

i created 1.3 for testing with additonal variables for pppoe in the minimal script.


BM..
jrussell88
DD-WRT User


Joined: 01 May 2009
Posts: 64

PostPosted: Sun Apr 08, 2012 20:58    Post subject: Complete update across firmware Reply with quote
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 downloaded the backupessentials script from:
Code:
wget -O /opt/usr/sbin/backupessential http://wd.mirmana.com/backupessential
# wget -O /opt/usr/sbin/vars_to_skip http://wd.mirmana.com/vars_to_skip
# wget -O /opt/usr/sbin/vars_to_include http://wd.mirmana.com/vars_to_include
# wget -O /opt/usr/sbin/vars_preferred http://wd.mirmana.com/vars_preferred


There are some differences between the wiki version and this - the download seems to be slightly improved and more nvram settings are listed.

As I'm not running optware I set up an equivalent directory structure under /jffs:
Code:
mkdir /jffs/opt
mkdir /jffs/opt/tmp
mkdir /jffs/opt/usr
mkdir /jffs/opt/usr/sbin
mkdir /jffs/opt/var
mkdir /jffs/opt/var/backups
and changed the two setup variables in the backupessential.sh script to point to the jffs directories:
Code:
FOLDER=/jffs/opt/var/backups
VARFILE=/jffs/opt/tmp/all_vars

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.
unlucky1
DD-WRT User


Joined: 09 Mar 2013
Posts: 75

PostPosted: Mon Sep 02, 2013 4:03    Post subject: Re: Complete update across firmware Reply with quote
jrussell88 wrote:

# wget -O /opt/usr/sbin/vars_to_skip http://wd.mirmana.com/vars_to_skip
# wget -O /opt/usr/sbin/vars_to_include http://wd.mirmana.com/vars_to_include
# wget -O /opt/usr/sbin/vars_preferred http://wd.mirmana.com/vars_preferred
[/code]


So, can anyone tell me if I use this script:http://www.dd-wrt.com/phpBB2/viewtopic.php?p=460679#460679
and add the above files, will it work with an Atheros router?

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
lowdrag
DD-WRT Novice


Joined: 28 Mar 2014
Posts: 2

PostPosted: Mon Apr 21, 2014 19:51    Post subject: Concise... Reply with quote
Can someone point to a doc that explains how to save the config and use it to apply to other ddwrt installations on varying hardware?

I want to add this to all my routers and have them all use the same settings/ configs / port fwding etc across all of them.

Trouble is when you try to read 22 pages of old stuff not knowing where the information you want is or if it's still valid.

There must be a better way to organize information form comments etc.

Ideas?

THanks all.
rnio
DD-WRT User


Joined: 21 Apr 2012
Posts: 94

PostPosted: Sun Nov 23, 2014 17:55    Post subject: Reply with quote
Here is my $0.02:

- took the script from this thread / wiki

- telnet into my CONFIGURED router

- 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)

Hope this helps,

Robert
ArjenR49
DD-WRT Guru


Joined: 05 Oct 2008
Posts: 663
Location: Helsinki, Finland / nr. Alkmaar, Netherlands

PostPosted: Fri Jun 26, 2015 15:05    Post subject: Reply with quote
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 ...
Goto page Previous  1, 2, 3 ... 21, 22, 23, 24  Next Display posts from previous:    Page 22 of 24
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum