nvram-save.sh: where do I get NVRAM variable from ?

Post new topic   Reply to topic    DD-WRT Forum Index -> Contributions Upload
Author Message
Shaggy1
DD-WRT Novice


Joined: 18 Jan 2017
Posts: 43

PostPosted: Sat Sep 10, 2022 10:21    Post subject: nvram-save.sh: where do I get NVRAM variable from ? Reply with quote
Hi

Current firmware version:
Code:
Firmware: DD-WRT v3.0-r44719 std (11/04/20)
Time: 12:14:17 up 5 days, 2:10, load average: 0.02, 0.02, 0.00
WAN IP: 185.219.109.4


Router type:
Code:
Netgear Nighthawk R7800

-----------------------------------------------

I am attempting to preserve some of my router settings before upgrading my router firmware and have been pointed at easyddup as a means that may allow me to do this.

I downloaded easyddup and am going through the instructions in QuickStart.txt. I got to the point where I run:
Code:
nvram-save.sh: NVRAM variable file not found: nvram-dd-wrt.ini


but this came up with a message:
Code:
nvram-save.sh: NVRAM variable file not found: nvram-dd-wrt.ini


Does anyone know where I should get this file from ?

Is it simply a matter of using the provided nvram-dd-wrt.ini.sample for this or do I need to somehow generate this file from my current routing settings ?
Sponsor
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5700

PostPosted: Sat Sep 10, 2022 12:06    Post subject: Reply with quote
Just take screenshots, or valid webpage saves, and log nvram show output then start over.
nvram show > /tmp/backupfilename.txt then download with WinSCP or do whatever below.

macOS terminal copying to clipboard: 'cat /tmp/file.txt | pbcopy' or 'pbcopy < /tmp/file.txt'
also macOS has scp command. Fairly certain R7800 has sftp too so FileZilla, Cyberduck etc.

Another way is Telnet/SSH as root in PuTTY with logging enabled and then run nvram show,
or click upper-left corner of PuTTY window copy all to clipboard then paste into Notepad++.

After a successful Ethernet webUI flash upgrade (dropdown select do not reset) or CLI flash,
verify the new build is up running perform webUI factory defaults or nvram erase && reboot.

Most search engines support 'site:forum.dd-wrt.com' to narrow scope of keywords or terms,
web search engine operators - + "" AND OR | * and more for better results. DD-WRT forum:
Search for all terms, Display results as: Posts & Return first 1000, or all characters of posts.

nvram show equivalent to GUI backup settings
Saving dd-wrt config settings in plain text, tips and tricks
easyddup a simple upgrade/downgrade utility
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 372

PostPosted: Sun Sep 11, 2022 18:50    Post subject: Re: nvram-save.sh: where do I get NVRAM variable from ? Reply with quote
Shaggy1 wrote:
Does anyone know where I should get this file from ?

Is it simply a matter of using the provided nvram-dd-wrt.ini.sample for this or do I need to somehow generate this file from my current routing settings ?

You can just run easyddup -n (the -n ensures no firmware upgrade is done) once and the missing nvram variables file will be there (or copy the nvram sample file manually).

Before upgrading, to test if all the settings you care about are restored by the script you can do a backup in Administration->Backup. Reset your settings and run the restore script. If a setting is missing; restore the backup just created. Add the missing variable name to the nvram variable file and repeat the process.
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5700

PostPosted: Sun Sep 11, 2022 19:20    Post subject: Reply with quote
To speed up that process run a text editor diff between before and after nvram show output logs or diffchecker etc.
Shaggy1
DD-WRT Novice


Joined: 18 Jan 2017
Posts: 43

PostPosted: Sat Oct 01, 2022 15:44    Post subject: Reply with quote
Thank you for your replies.

I ran easyddup -n and it did indeed generate a .ini file.

After that I ran nvram-save.sh which ran through this time.

The easydup run also generated a file:
backup/nvram-restore-202209251018-C648.sh

To confirm: once I have downloaded the new firmware I should be able to run backup/nvram-restore-202209251018-C648.sh to re-configure the router to what I had on the previous build ?

And once I have done that, I should then be able to run nvram-save.sh again to generate a text file that writes the new config to a txt file (eg backup50176.txt) and check for any differences by doing a diff between the previous backupr44719.txt and backup50176.txt
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 372

PostPosted: Sun Oct 02, 2022 4:28    Post subject: Reply with quote
I see you have an r7800. One of my dev/backup routers is an r7800 so I can participate with you.

Dd-wrt's Administration->Backup is great and saves everything but it can only be used to restore to the same exact build you backed up from. Conversely, nvram-save cherry picks certain user settings variables only and is safe to use between builds.

The problem is that unless you are lucky, you may notice that the restore script doesn't bring back absolutely all of the settings you care about. Note that when you run easyddup.sh -n and say Y to "Save user settings restore point y/n ?" it runs nvram-save so no need to run nvram-save separately. When you run many times you end up with multiple dated restore scripts but nvram-restore-latest.sh always points to the latest one.

After nvram erase, reboot, nvram-restore-latest.sh; if we notice a missing setting, we restore the dd-wrt backup, add the missing variable to nvram-dd-wrt.ini and create the restore point again, nvram erase, nvram-restore-latest.sh and see if everything is restored.

Once the nvram-dd-wrt.ini saves & restores all we need, we can use easyddup without the -n, upgrade and after rebooting and preferably creating a new dd-wrt backup for the new build, run nvram-restore-latest.sh to get the settings back.

Future upgrades are trivial with easyddup after that or just restoring our correct settings when something gets messed up in dd-wrt.
the-joker
DD-WRT Developer/Maintainer


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

PostPosted: Sun Oct 02, 2022 10:44    Post subject: Reply with quote
Actually the backup is not restricted to the same exact build (what gave you this idea?), I have backups from 49051 which work perfectly fine on 50308 (funnily enough I just did this yesterday for testing something unrelated, but I went back to the bakup I took before I reset the router and restored the older backup). But I know what Im doing more or less (enough to do serious damage), I follow development and know what nvram variables have been removed/added.

We just tell users not to because its the best way to avoid gremlins this comes often with resets and manual reconfiguration to ensure sanity, because most of the users are coming from absurdly old stuff and go back and forth between builds that are not comparable so risks of nonsense increase.

_________________
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)
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 372

PostPosted: Sun Oct 02, 2022 12:58    Post subject: Reply with quote
can/should... tomayto/tomahto

Please start a thread in the appropriate forum if you want to encourage restoring backups to different builds. Don't hijack a thread in Contributions Upload.
Shaggy1
DD-WRT Novice


Joined: 18 Jan 2017
Posts: 43

PostPosted: Sat Oct 15, 2022 16:07    Post subject: Reply with quote
Hi

Thank you very much for your reply.

To clarify:

I should simply need to:
1) run ./easyddup.sh
2) Go to Administration->Firmware Upgrade, select my downloaded bin file, press Upgrade *
3) once the the firmware has upgraded reboot
4)run ./backup/nvram-restore-latest.sh

* what do I select for 'After flashing, reset to' don't reset, Reset to Default settings (or it doesn't matter?) ?

Quote:
After nvram erase, reboot, .....

Or do I need to do an nvram erase somewhere ?
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Contributions Upload 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 cannot attach files in this forum
You cannot download files in this forum