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.
@john9527 the nvram restore whilst migrating is now foolproof with the guided questions. Many thanks. When you next look to update the utility would it be possible to do the same for jffs, so that simply typing in ./jffs-restore.sh when tge usb stick is plugged into a different router brings up the same wizard-style questions regarding migration to a different router?

In the meantime, I've just migrated and it's that much easier especially if one is new to this or it's been a while since one last used it.
 
is the wps status and Wan: Use DNS probes to determine if WAN is up (default: Yes) saved in r26?
 
When you next look to update the utility would it be possible to do the same for jffs, so that simply typing in ./jffs-restore.sh when tge usb stick is plugged into a different router brings up the same wizard-style questions regarding migration to a different router?
Duh...brain check on my part, it should be the same. I'll add it for the next release. Thanks for pointing it out.
 
Glad to hear you worked it out @rtn66uftw. Might be worth to check the USB drive thoroughly to make sure it's actually 'clean' and won't cause any more issues. As for the filesystem you used to format it, both NTFS and Ext4 are 'journalling' filesystems, (which keep track of what happens on the drive, so in case of emergency they're more likely to be repaired for example), both with their own advantages. I prefer Ext4 as it is a linux filesystem and our routers are as well completely Linux-based (and I'm more of Linux kinda guy anyway). However, NTFS will do just fine, especially if you want or need easy access from a Windows pc or laptop. Just make sure the drive is in good health, as a backup written to a malfunctioning (thumb-)drive is of no use to anyone.

Just to double check, I reformatted my USB2 FIT to FAT32 and ran a backup/restore without any problems. Don't know why you would have had a problem unless something was corrupted on the stick to start with.

Thanks guys! I think the USB stick might be the problem. I used 3 other freshly formatted USB (NTFS) on 3 other routers without any issue.
 
is the wps status and Wan: Use DNS probes to determine if WAN is up (default: Yes) saved in r26?

Yes they are indeed, as @john9527 already confirmed. See the output below, where file1.txt (on the left of '<>') has both wps and wan status dns probes disabled and file2.txt has both functions enabled. I renamed both files (original filenames are (partially) mentioned in the first line of the diff-output) as I sorted them alphabetically in file1 and file2 to make sure all values where on the same line in the backup files for comparison. Output below has been modified by yours truly for better readability.
Code:
marco@netbook:~/Desktop$ diff --suppress-common-lines -y file1.txt file2.txt
All NVRAM Settings 201709070801 7130 <> All NVRAM Settings 201709070812 7130
dns_probe_content= <> dns_probe_content=131.107.255.255 fd3e:4f5a:5b81::1
wl0_wps_mode=disabled <> wl0_wps_mode=enabled
wl1_wps_mode=disabled <> wl1_wps_mode=enabled
wl_wps_mode=disabled <> wl_wps_mode=enabled
wps_enable=0 <> wps_enable=1
wps_enable_x=0 <> wps_enable_x=1
 
Last edited by a moderator:
Wan: Use DNS probes to determine if WAN is up (default: Yes) = no isnt being restored
WPS is fine though
 
Wan: Use DNS probes to determine if WAN is up (default: Yes) = no isnt being restored
WPS is fine though

Ahhh....I see it now. Quirk of the implementation. When you set it to No, the variable is set to an empty value. I don't save empty values.

Luckily, the latest version makes a fix easy :)
Open nvram-merlin.ini and find 'dns_probe_content' and put a '+' sign in front of it

+dns_probe_content


Strike that....will need a change to force the empty save.
 
Last edited:
Ahhh....I see it now. Quirk of the implementation. When you set it to No, the variable is set to an empty value. I don't save empty values.

Luckily, the latest version makes a fix easy :)
Open nvram-merlin.ini and find 'dns_probe_content' and put a '+' sign in front of it

+dns_probe_content


Strike that....will need a change to force the empty save.
Hey, do that for the DNSFilters too if a user deletes out the standard ones, and saves value 3, for example, as an empty variable. :) We chatted about that once before.
 
I don't save empty values.

Ah, I wasn´t aware of that, just compared both files and spotted the differences with both features on and off.

Edit: apparently you do save them (otherwise I couldn't have spotted it in the diff output I posted yesterday, second line), so my guess would be you do save but don't restore them?

There's a script somewhere on the forum cleaning out the empty values to save some memory, might as well place a warning there that it's unsafe to use, are some values are apparently stored empty on purpose. I honestly learn something here every day.

Why did you choose not to restore empty values @john9527, if I may ask ?
 
Edit: apparently you do save them (otherwise I couldn't have spotted it in the diff output I posted yesterday, second line), so my guess would be you do save but don't restore them?

There's a script somewhere on the forum cleaning out the empty values to save some memory, might as well place a warning there that it's unsafe to use, are some values are apparently stored empty on purpose. I honestly learn something here every day.

Why did you choose not to restore empty values @john9527, if I may ask ?
I assure you, I don't save empty values (or null values). Done for performance reasons. For example, all the variables associated with the vpn client for instances that aren't used and are null. They will be restored by the factory reset.

In the case of the dns_probe_content, if dns probes are disabled, it will exist in the before case with an empty value (set to ""). After the factory reset, it's set to a value of the dns probe server, but the empty value wasn't saved to restore.

Regarding that script to clear nvram....it is risky. There is a difference between and empty value or null value and a variable that doesn't exist. In most cases, the routines that read the nvram take care of it (for example returning a '0' for integers or an empty string for strings if it doesn't exist), but there are cases that can be constructed where it doesn't work right.
 
Last edited:
When moving to a HIGHER level of firmware (V26E4 to V27E5) what should the answer be to the question below Y or N...I'm a bit confused. Thanks very much.

"Perform a clean restore and remove ununsed NVRAM variables [Y/N]?"
 
what should the answer be to the question below Y or N...I'm a bit confused. Thanks very much.

When moving between fork levels, it's pretty much a wash. If you answer N, there are a couple of transient settings you will be asked to re-verify (for example, you will get an alert (the exclamation point) if you have guest access for Samba or FTP.

It's more important if you are moving between Merlin and the Fork, or downleveling the firmware, or use your own 'custom' nvram variables in scripts (for example, I set some variables in my own blocking scripts).
 
i have done it but get in trouble. so i made a factory reset.

also i have tryed the programm nvram-backup but all were fine after finish i try to flash it back, but:

admin@R7000-F5D5:/tmp/mnt/ASUS# ./nvram-restore.sh

Last nvram save/restore (nvram-restore-.sh)
WARNING: Last nvram-save MAC address ()
does not match current router MAC (F5D5)!
This may be valid if you are migrating settings from one router to another

If you wish to use a different restore file, answer N and specify the
restore file id the command line in the form
yyyymmddhhmm-mmmm

Do you want to proceed [Y/N]?y
Restore using last nvram save (nvram-restore-.sh) [Y/N]?y

Script /tmp/mnt/ASUS/backup/nvram-restore-.sh does not exist. Exiting.

admin@R7000-F5D5:/tmp/mnt/ASUS#


so i dont know why it want find the right one. but if i try to do: nvram-restore-201709102056-F5D5.sh
it do nothing:
admin@R7000-F5D5:/tmp/mnt/ASUS# ./nvram-restore-201709102056-F5D5.sh
admin@R7000-F5D5:/tmp/mnt/ASUS#
 
NVRAM backup missing new RMerlin 'VPN Client description' variables ?
Code:
admin@RT-AC68U:/tmp/mnt/RT-AC68U/BackupScriptsJFFS# nvram get vpn_client1_desc
HMA New York

admin@RT-AC68U:/tmp/mnt/RT-AC68U/BackupScriptsJFFS# grep vpn_client1_desc nvram-restore-201709141243_RT-AC68U-E4A0.sh
admin@RT-AC68U:/tmp/mnt/RT-AC68U/BackupScriptsJFFS#
 
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
 
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