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 ... , 22, 23, 24  Next
Author Message
ArjenR49
DD-WRT Guru


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

PostPosted: Fri Jun 26, 2015 21:03    Post subject: Reply with quote
I pinpointed the problem with the script (above post) to a single line.
See post http://www.dd-wrt.com/phpBB2/viewtopic.php?p=972356#972356
There seems to be a problem with the NVRAM command in version 27396, at least.
Sponsor
px03afk
DD-WRT User


Joined: 09 Mar 2012
Posts: 95

PostPosted: Thu Aug 06, 2015 13:46    Post subject: Reply with quote
I'm very grateful for the work that has been done on this script. I decided that for my setup it was more convenient to mount my server share on the router and run the script directly from the server. That avoids the need for adding anything to the router, assuming that the version being used supports mounting a samba share.

I've already used the script to copy some port forwarding data from one router to another. It worked as expected, although the GUI on the target router didn't reflect the additional routes until I clicked on Add, at which point each of the additional routes showed itself, one for each click. That's on DD-WRT v24-sp2 (12/15/14) big - build 25648 on Netgear WNR3500L routers
px03afk
DD-WRT User


Joined: 09 Mar 2012
Posts: 95

PostPosted: Thu Aug 06, 2015 21:15    Post subject: Reply with quote
I've just found that one of my routers doesn't have the tee command. It's a WNDR3700 v4 running DD-WRT v24-sp2 (04/01/15) std - build 26635. The only reason I mention is so that if anyone else finds that they want to use the script and they don't have tee, they can overcome the problem by changing the tee lines into duplicate commands with the output going to the individual files.

Might that be a slightly better option to allow for builds which don't have tee?
juliushibert
DD-WRT Novice


Joined: 18 Jul 2010
Posts: 44

PostPosted: Sun Oct 18, 2015 11:08    Post subject: Reply with quote
Is there anyway to get this script to work with rsync or an encrypted connection rather than plain FTP?
_________________
Buffalo WZR-HP-AG300H: DD-WRT v3.0-r32170 std (06/01/17)
juliushibert
DD-WRT Novice


Joined: 18 Jul 2010
Posts: 44

PostPosted: Sun Jul 24, 2016 16:26    Post subject: Reply with quote
I keep getting ./backup-settings.sh: line 132: tee: not found. Is there a package for tee for Atheros AR7161 rev 2 based routers as I can't seem to find one on the openwrt repo.
_________________
Buffalo WZR-HP-AG300H: DD-WRT v3.0-r32170 std (06/01/17)
u2n
DD-WRT Novice


Joined: 19 May 2017
Posts: 20
Location: TN<>MI, US

PostPosted: Mon May 22, 2017 16:40    Post subject: Reply with quote
This thread died off after much of the logic was put into the web interface. But it's still widely linked and comes up tops (or high) in searches. So as a public service, here's an offering of the current status:

  • For simple upgrades of the same firmware on the same device, just use the web GUI: Administration | Backup, Backup, then flash upgrade, then Restore. No need for scripts or to go manually page-by-page. (Restoring earlier backups used to be a caveat; not anymore.)

  • Clear text NVRAM backups can still be made the old way: nvram show > nvram.txt

  • To transfer existing settings quickly from one device to another, this script can be tried. Success is not assured and difficulties are to be expected.


Now if someone could figure out how to bring back the beloved frater, who started this thread long ago...

_________________
My old self (phonetics-R-fun)
jass1989
DD-WRT Novice


Joined: 11 Jul 2016
Posts: 22

PostPosted: Mon Sep 03, 2018 3:10    Post subject: Reply with quote
Bringing back to life this thread. working with a few diffrent hardware. need to backup my WIFI and ip settings along with Static Leases

now I have made the scrip but cannot execute. chmod 777, still wont run... suggestions?
jdwh2
DD-WRT Novice


Joined: 20 Jun 2022
Posts: 3

PostPosted: Mon Jun 20, 2022 20:25    Post subject: Reply with quote
So after coming across this thread and looking elsewhere I found a github repo that saved a version and has been updating it (last update was 10 months ago as of this post). I figured I'd share my method to get this to work on my router. Minimal Linux/shell experience required.

I logged onto router usint PuTTY SSH access and ran the following code, once I had Entware and /opt on the USB (not sure if necessary but it works).


Code:
#https://github.com/slycordinator/dd-wrt.backupessential/tree/shellcheck_cleanup

#works with Entware setup on USB
curl -LJO https://raw.githubusercontent.com/slycordinator/dd-wrt.backupessential/shellcheck_cleanup/backupessential > /opt/usr/sbin/backupessential
curl -LJO https://raw.githubusercontent.com/slycordinator/dd-wrt.backupessential/shellcheck_cleanup/vars_to_skip > /opt/usr/sbin/vars_to_skip
curl -LJO https://raw.githubusercontent.com/slycordinator/dd-wrt.backupessential/shellcheck_cleanup/vars_to_include > /opt/usr/sbin/vars_to_include
curl -LJO https://raw.githubusercontent.com/slycordinator/dd-wrt.backupessential/shellcheck_cleanup/vars_preferred > /opt/usr/sbin/vars_preferred

#run backup script and backup to /opt/home/backup_files
sh /opt/usr/sbin/backupessential -d /opt/home/backup_files



Then in a command window on the computer I ran.
Code:

#copy backup script files to computer with scp (run scp on computer) and replace ***ROUTER_IP*** with actual router IP
scp root@***ROUTER_IP***:/opt/home/backup_files/* ./backup_files


I now have backup .sh files on both my USB drive, and on my computer that are time and date stamped.

Maybe there's a better way, but this took me a minute to figure out so I thought I'd share in case it's useful for anyone who wants a straightforward way to do this.

Cheers!!! Laughing Smile
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6410
Location: UK, London, just across the river..

PostPosted: Mon Jun 20, 2022 20:40    Post subject: Reply with quote
im not sure if its a good idea to save back up and restore on different hardware at all...may be if you save only the essentials that are common between all the possible builds(consider 4MB, 8MB, 16MB and 32+ flash size)...than it may work but you still have to restore or make some other functions to work...
even restoring same builds on 2 same router models same hardware...its a bit risky due to a bad blocks in the ram...for example R7800 to R7800 or 1043v2>1043v2...not that i have not done it..but its not a good idea.. Cool Cool...especially on R7800 where those are known with bad blocks in memory..

the best i do is usually based on those commands:

nvram backup /opt/store/1043v2.bin
nvram restore /opt/store/1043v2.bin
or
nvram show > /opt/bckup/nvram_output.txt than either read with nano or vi or WSCP to PC and read there

there are indeed few scripts that kind of work, but no idea how they handle the new mem locations and ect. when those happen on a new builds..
bear in mind, some variables and functions could be removed or relocated on a new/different builds and thus is why reset after update and manual rebuild is required...at least this is my poor understanding of back ups and restore...

i guess someone will chime in to say something else more valuable on the subject... Rolling Eyes

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55179 WAP
TP-Link WR1043NDv2 -DD-WRT 55303 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55460 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55460 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55363 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913


Last edited by Alozaros on Mon Jun 20, 2022 22:04; edited 1 time in total
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1899

PostPosted: Mon Jun 20, 2022 20:54    Post subject: Reply with quote
Same router model to same router model is benign, unless you can infallibly prove otherwise instead of using speculation and conjecture that may result in misinformation.

[Solved] Using "Admin > Backup" and pitfalls

Of course, this thread is ancient history, but I can't fathom any reason why anyone would want to transfer Broadcom nvram vars to Atheros or any such risky venture. The original premise was probably between different Broadcom routers (?)
jdwh2
DD-WRT Novice


Joined: 20 Jun 2022
Posts: 3

PostPosted: Mon Jun 20, 2022 22:00    Post subject: Reply with quote
My use case was far less controversial than trying to move settings from a Broadcom router to an Atheros. I was looking for a good way to backup *text* nvram commands as I'm trying to get VAP VPN routing working while also having a way to preserve settings through upgrades since it seems to be the consensus that restoring a bin backup after an upgrade can lead to bricking the router.

From the sticky thread above this message this tool is available:

https://github.com/0ki/ddwrt-nvram-tool

Which says it will let you convert your binary backup files to text nvram commands, but it seems that the advantage of the script is you can designate variables to ignore.

This script in this thread by frater and others was apparently included in OTRW (https://infodepot.fandom.com/wiki/Backup_settings_and_restore_them) but I have Entware loaded and couldn't find a version there.

So to summarize, although this thread is old, it does still seem to contain the most comprehensive way to backup nvram settings as text while controlling variables to include.

If there is another more current way to do that it would be great to redirect me and others to it, otherwise again, perhaps my contributions are accessible and useful in some cases.
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1899

PostPosted: Mon Jun 20, 2022 22:10    Post subject: Reply with quote
OTRW is also ancient history and deprecated; I am failing to grasp the connection to Entware in this whole premise (?). Please don't take my commentary as dismissive or not thankful or grateful for your input. It is always great to have people making contributions and being helpful around here.
_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
jdwh2
DD-WRT Novice


Joined: 20 Jun 2022
Posts: 3

PostPosted: Tue Jun 21, 2022 8:09    Post subject: Reply with quote
Sure thing! Typically I'll read through a bunch of threads on topics like this in forums like this and try to figure something out and then when I do, try to leave a comment about what I did.

I'll do this both as a reference for other people who might be trying this same or a similar task but also for myself in the event that I need to be reminded.

As far as why I mention Entware and OTRW and it's because this script was provided on OTRW but doesn't seem to be available or included in/as an Entware package. So while "ancient" and "deprecated" OTRW seems to have scripts which Entware packages don't (to be expected), but are still useful (namely this one).


As far as spreading misinformation about using binary backups to copy settings to an upgraded router my understanding that it's a bad idea comes from this page (https://wiki.dd-wrt.com/wiki/index.php/Installation) where it says:

"Upgrading to a Newer Version of DD-WRT
If DD-WRT is already installed on your router, you can simply upgrade to a new version via the web interface or TFTP. However, it is highly recommended that you restore the router to defaults using the reset button before and after flash. Never restore old backups from previous versions! Skipping these steps could lead to a bricked device!"

Hopefully that addresses your comment, "Same router model to same router model is benign, unless you can infallibly prove otherwise instead of using speculation and conjecture that may result in misinformation."

If misinformation is contained in the Installation instructions that's not an ideal situation. Or perhaps I'm misunderstanding what you meant?

In any case interesting discussion!
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Tue Jun 21, 2022 10:28    Post subject: Reply with quote
An easy way to have human readable backups for reference or passing to scripts for restoring is possible.

I often recommend [b]nvram show > /tmp/some-bkpid-date.text/b] which can be then grabbed to desktop with scp for instance.

Obviously restoring backups to different hardware is never going to work but there are settings that are common like static leases or others where the parameters and values could be interchangeable, obviously not all and only by studying the configs one can determine this.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1899

PostPosted: Tue Jun 21, 2022 14:11    Post subject: Reply with quote
Sorry, my misinformation rhetoric was not directed at you, jdwh2. The information in the wiki regarding using older version backups applies to nvram variable changes and other gremlins, specifically. At some point, nvram backups now have a firmware version number in the filename. I have not seen any hard evidence that the firmware version number addition prevents using the backup on a different version of DD-WRT myself, but if someone can provide absolute proof, that would be quite welcomed.
_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
Goto page Previous  1, 2, 3 ... , 22, 23, 24  Next Display posts from previous:    Page 23 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