What's new

User NVRAM Save/Restore Utility (R26.2)

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Status
Not open for further replies.
Next release of the utility is available. Thanks to everyone who provided feedback/suggestions!

LATEST RELEASE: Release 26.1
15-September-2017
nvram-save-r26.1.zip
Download http://bit.ly/2aaAySO
===============================

Version 26.1 Highlights (Full Changelog history is available in the download directory)
  • Update prompts during jffs-restore to better address migrations - @martinr
  • Enhanced support for processing variables which may have a valid 'empty' value.
    This fixes saving of dns_probe and dns_filter settings - @Shonk @cybrnook
  • Add support for separate user variable adds via nvram.ini.add
  • Resync with new adds for 380.68 - @Martineau

SHA256 hash:

Code:
646357f9ce434d4cad6454b89b0e84d8ebfbfdea4828d82733dc06a714898d61  nvram-save-r26.1.zip
Thank you @john9527! This is a great tool/utility. I appreciate the work you do keeping it updated.
 
A maintenance release of the utility is available. Only nvram-save.sh was updated to version 26.2 to correct a problem in generating the restore file.

LATEST RELEASE: Release 26.2
22-September-2017
nvram-save-r26.2.zip
Download http://bit.ly/2aaAySO
===============================

Version 26.2 Highlights (Full Changelog history is available in the download directory)
  • Corrects a problem where variables marked for a forced restore may not be restored

SHA256 hash:

Code:
6cf18e1f93d4b8eb4b768a56e8aca3e676630192ebcb15834577face4b8e9263  nvram-save-r26.2.zip
 
Just a quick note for those getting AC86U's and running Merlin's 382 alpha code.....will the tool still work to migrate from a different router? Good question.
There are some differences that are introduced in the 382 build...at the very least (based on some info from Merlin) it will likely restore some nvram variables that are not required, depending on your configuration. I'm currently thinking about ways to handle the changes.
 
Just had a router go bad that I had been doing some development work on for OpenVPN Selective Routing. Thanks to the nvram backup and restore utility, I am super GRATEFUL that I have a backup of the scripts and router settings! Thank you @john9527!
 
Last edited:
@john9527 @RMerlin

Can we have this topic pinned in the forum please, since it is widely used and referred to, and not always easy to find (short of bookmarking, of course)!

I don't want to make this forum turn into the DD-WRT Broadcom forum, where you have to scroll through so many sticky posts that nobody pays any attention to them anymore, and nobody even notices when a new sticky gets added. It's currently referenced in the important links post.
 
A maintenance release of the utility is available. Only nvram-save.sh was updated to version 26.2 to correct a problem in generating the restore file.

LATEST RELEASE: Release 26.2
22-September-2017
nvram-save-r26.2.zip
Download http://bit.ly/2aaAySO
===============================

Version 26.2 Highlights (Full Changelog history is available in the download directory)
  • Corrects a problem where variables marked for a forced restore may not be restored

SHA256 hash:

Code:
6cf18e1f93d4b8eb4b768a56e8aca3e676630192ebcb15834577face4b8e9263  nvram-save-r26.2.zip

@john9527

Apologies, I have made some unauthorised personal tweaks to your excellent scripts to make life a little easier for some of my less technical command-line users.

0. Add cosmetic colour to messages - they like Green for good, Red for 'whoops':D and 30-40 second speed reduction in the full backup time

1. Include the name of the actual router model in the file names, as I support several routers and remembering which is which by the MAC suffix is too taxing. :p

2. Menu List the available restore files so I can also quickly pick the one to be used rather than accept the default 'most recent'
e.g. JFFS restore
Code:
./jffs-restore.sh

jffs-restore.sh: JFFS Restore Utility - Version 26.1

1.   jffs-201709121645_RT-AC68U-E4A0/
2.   jffs-201709181925_RT-N66U-C978/
3.   jffs-201710040939_RT-AC68U-E4A0/
4.   jffs-201710040944-E4A0/
5.   jffs-201710080820_RT-AC68U-E4A0/
6.   jffs-201710080847_RT-AC68U-E4A0/
7.   jffs-201710080941_RT-AC68U-E4A0/
8.   jffs-201710081513_RT-AC68U-E4A0/
9.   jffs-201710082011_RT-AC68U-E4A0/
10.  jffs-201710091028_RT-AC68U-E4A0/
11.  jffs-201710091223_RT-AC68U-E4A0/
12.  jffs-201710091313_RT-AC68U-E4A0/

    Restore last saved /jffs/ ? (jffs-201710091313_RT-AC68U-E4A0) { n | Y } (or press ENTER to ABORT) >

    Restore aborted

Similarly for the NVRAM restore, and it also lists which version of the firmware is in the restore file.

Also to keep the number of files in the list to one page, I also allow deleting of a single 'Backup' or range.
i.e. you can see below I have been testing some scripts/features and have made frequent saves, as well as the top four in the list being from other models/days

...so I decided that I don't need the 'temporary' interim backups 5 and 6 so erased them (along with their associated JFFS backups)
Code:
./nvram-restore.sh

1.    nvram-restore-201709121645_RT-AC68U-E4A0.sh  Ver=380.68_0
2.    nvram-restore-201709181925_RT-N66U-C978.sh  Ver=--------
3.    nvram-restore-201710040939_RT-AC68U-E4A0.sh  Ver=380.68_2
4.    nvram-restore-201710040944-E4A0.sh  Ver=--------
5.    nvram-restore-201710080820_RT-AC68U-E4A0.sh  Ver=380.68_4
6.    nvram-restore-201710080847_RT-AC68U-E4A0.sh  Ver=380.68_4
7.    nvram-restore-201710080941_RT-AC68U-E4A0.sh  Ver=380.68_4
8.    nvram-restore-201710081513_RT-AC68U-E4A0.sh  Ver=380.68_4
9.    nvram-restore-201710082011_RT-AC68U-E4A0.sh  Ver=380.68_4
10.   nvram-restore-201710091028_RT-AC68U-E4A0.sh  Ver=380.68_4
11.   nvram-restore-201710091223_RT-AC68U-E4A0.sh  Ver=380.68_4
12.   nvram-restore-201710091313_RT-AC68U-E4A0.sh  Ver=380.68_4

    Restore last NVRAM save ? (nvram-restore-201710091313_RT-AC68U-E4A0.sh) { n[{-n}] [ del ] | Y } (or press ENTER to ABORT) > 5-6 del
    Deleted                   (*201710080820_RT-AC68U-E4A0.*)
    Deleted                   (*201710080847_RT-AC68U-E4A0.*)

3. Real-time progress metrics of the time taken for the individual '.ini' Category saves (and the total elapsed time recorded in nvram-util.log) together with a visual reminder of which Categories I may have temporarily excluded in the '.ini' file (six shown below e.g. Astrill)
Code:
./nvram-save.sh

nvram-save.sh: NVRAM User Save Utility - Version 26.2 EIC Hacked!!
nvram-save.sh: Saving RT-AC68U settings from firmware 380.68_4
nvram-save.sh: Using standard NVRAM variable file: nvram-merlin.ini Version=26.1
nvram-save.sh: Running in Backup Mode

 Saving [System - Basic]                  5 secs (52  variables, Bytes=101  Total=101  )
 Saving [System - Other]                  6 secs (52  variables, Bytes=900  Total=1001 )
 Saving [Tweaks & Hidden settings]        3 secs (31  variables, Bytes=50   Total=1051 )
 Saving [Disk Utility]                    1 secs (12  variables, Bytes=10   Total=1061 )
 Saving [Switch Control]                  0 secs (3   variables, Bytes=3    Total=1064 )
 Saving [NAT Passthrough]                 1 secs (8   variables, Bytes=8    Total=1072 )
 Saving [TCP/UDP settings]                1 secs (3   variables, Bytes=44   Total=1116 )
 Saving [Port Forwards]                   0 secs (3   variables, Bytes=383  Total=1499 )
 
 <snip>
 
 Saving [Email settings]                  3 secs (10  variables, Bytes=11   Total=9456 )
       #[KeyGuard settings]               3 secs (?   variables, Bytes=0    Total=9456 )
       #[WTFast settings]                 1 secs (?   variables, Bytes=0    Total=9456 )
 Saving [TOR VPN settings]                1 secs (6   variables, Bytes=13   Total=9469 )
       #[ChilliSpot settings]             1 secs (?   variables, Bytes=0    Total=9469 )
       #[HotSpotSystem settings]          1 secs (?   variables, Bytes=0    Total=9469 )
       #[Captive Portal settings]         0 secs (?   variables, Bytes=0    Total=9469 )
 Saving [Traffic Control settings]        1 secs (11  variables, Bytes=0    Total=9469 )
 Saving [VLAN Settings]                   1 secs (5   variables, Bytes=0    Total=9469 )
       #[Astrill VPN settings]            1 secs (?   variables, Bytes=0    Total=9469 )
 Saving [User Adds]                       1 secs (0   variables, Bytes=0    Total=9469 )

nvram-save.sh: Complete: User NVRAM saved to /tmp/mnt/RT-AC68U/BackupScriptsJFFS/nvram-restore-201710091628_RT-AC68U-E4A0.sh

nvram-save.sh: Complete: JFFS directory saved to /tmp/mnt/RT-AC68U/BackupScriptsJFFS/jffs-201710091628_RT-AC68U-E4A0

nvram-save.sh: Complete: Processed user exit script /tmp/mnt/RT-AC68U/BackupScriptsJFFS/nvram-user.sh

nvram-save.sh       201710091628_RT-AC68U-E4A0    Mon Oct  9 16:31:54 DST 2017    380.68_4                 #Version=26.1 3 minutes and 32 seconds elapsed, Total Bytes=9469
jffs-save           201710091628_RT-AC68U-E4A0    Mon Oct  9 16:31:59 DST 2017

Not sure if you already have similar end-user friendly ideas for future releases or are interested in my hacked scripts as-is?
 
Last edited:
I don't want to make this forum turn into the DD-WRT Broadcom forum, where you have to scroll through so many sticky posts that nobody pays any attention to them anymore, and nobody even notices when a new sticky gets added. It's currently referenced in the important links post.

Hi Merlin. Just curious where is the important links post...just can't seem to find it. Sorry.
 
Perform a clean restore and remove ununsed NVRAM variables [Y/N]?Y

nvram-restore: NVRAM User Restore Utility - Version 26.1
nvram-restore: Using standard NVRAM variable file: nvram-merlin.ini Version=26.1
nvram-restore: Restoring settings from firmware 380.68_3 201709251935-0000
nvram-restore: Clean NVRAM option specified
/tmp/mnt/sda1/C/Nvram/nvram-restore-201709251935-0000.sh: line 46: can't open /tmp/nvram.ini: no such file

this a problem?
using 26.2 btw

i have done a non clean restore for now as it was from380.68_3 anyway but usually use clean restore
 
/tmp/mnt/sda1/C/Nvram/nvram-restore-201709251935-0000.sh: line 46: can't open /tmp/nvram.ini: no such file

this a problem?
using 26.2 btw
Yes, and was fixed in 26.2 (should have said for folks to do a fresh save). With the handling of empty variables, forced restores, etc the restore now needs access to the nvram-merlin.ini that was used to create it.

for now, copy nvram-merlin.ini to /tmp/nvram.ini prior to starting the restore. Then the clean restore should work.
Then do a fresh save on 26.2 which will save a copy of the exact ini file for later use.
 
Last edited:
I can't access the download site. Something wrong with the certificate?

Code:
Secure Connection Failed

An error occurred during a connection to onedrive.live.com. You have received an invalid certificate. Please contact the server administrator or email correspondent and give them the following information: Your certificate contains the same serial number as another certificate issued by the certificate authority. Please get a new certificate containing a unique serial number. Error code: SEC_ERROR_REUSED_ISSUER_AND_SERIAL

    The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
    Please contact the website owners to inform them of this problem.
 
It works for me.
Thank you! I was signed onto my pfSense appliance when I tried to access the site. It looks like pfBlockerNG is blocking it. I can't reproduce the error now. I now get a .gif page. I can access the site when I log onto the AC88U.
 
Last edited:
I can't access the download site. Something wrong with the certificate?

Works OK for me as well. If you are running any addon anywhere that does 'Windows tracking protection', try disabling that. Most of those will break OneDrive access.
 
Thank you! I was signed onto my pfSense appliance when I tried to access the site. It looks like pfBlockerNG is blocking it. I can't reproduce the error now. I now get a .gif page. I can access the site when I log onto the AC88U.
upload_2017-11-4_8-4-48.png
 
Just a quick note for those getting AC86U's and running Merlin's 382 alpha code.....will the tool still work to migrate from a different router? Good question.
There are some differences that are introduced in the 382 build...at the very least (based on some info from Merlin) it will likely restore some nvram variables that are not required, depending on your configuration. I'm currently thinking about ways to handle the changes.
Any update on the analysis? I have been reluctant to migrate to 382.xx without the nvram utility supporting the jump from 380.68 to 382.xx. More often than not, I have to factory reset and restore using the nvram utility after a FW upgrade in order to get my OpenVPN Clients to perform as expected. I have become dependent on the nvram utility to help me with this.
 
Status
Not open for further replies.

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top