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.
Hi there, just new here,

Thanks for Tools, it seems great,
Just A dummy here and hard to understand how to save my WHOLE Asus AC66U before upgrading to the Merlin.
I want upgrade but need to keep original config for RMA if needed.
Could you just show the commands to save all file and partition from telnet of Asus AC66T.

Thanks a lot and very sorry for HYPER DUMMY.
 
Use the Save setting under the Administration, Restore / Save / Upload tab.

I suggest you do a reboot before saving this file. Also keep a copy of your current firmware.

After upgrading to the RMerlin version you want, do a factory restore to defaults on the same page.

After setting up the router manually and minimally to connect to your ISP and secure your router, do another Save along with this version of the firmware.

Now you can upgrade or downgrade as you want between these two with minimal hassle.
 
Command line not needed. Just use the gui.
 
I think with your method the user preference is not restored !
I would like to make a clon as HDD or something like that, get full restore.

Joe said :
Hi,

You can use the NVRAM Save/Restore Utility to move your user settings from one firmware to the next one - do not forget to do a factory reset before you use the utility.
Do NOT use the backup/restore function of the routers firmware - as described here!

Always use the latest version of Merlin - as described in the first posting of the Asuswrt-Merlin 378.51 is out thread.

With kind regards
Joe :cool:
 
This NVRAM save/restore utility is extremely helpful!

I manage routers for remote family members though, and doing a factory reset is still pretty difficult... when the router comes back up you have to switch a computer to the default subnet and then do some basic setup to get to the point where you can enable SSH to be able to run the restore script. It is very difficult to walk a non-technical person through this process at a remote location :)

As a potential solution...
* The nvram-save script could create an "nvram-restore.sh" symlink in the root of the USB drive that points at the most recent save file.
* When you choose the "Restore Factory Settings" option from the gui, the router could clear the settings and reboot.
* If the firmware detects it is booting for the first time, and if /mnt/ASUS/nvram-restore.sh exists, instead of running the first time setup wizard, run the nvram_restore script and reboot again
* Now when the router reboots it will have all the right settings

This would make it trivial to do a factory reset, even at a remote location. Does something like this seem doable?
 
There were several variables related to https support that weren't picked up since they didn't show up in the gui. I'll pull them in for the next update.

https_crt_gen
https_crt_save
https_enable
https_crt_file
https_crt_cn


thanks, and the device marked as "Highest" piority in Adaptive QoS->Bandwidth Monitor section as well
 
'nvram-excp-merlin.sh' has an error : "[[: 2678: unknown operand"
Code:
# sh -x ./nvram-excp-merlin.sh
+ nvram get buildno
+ buildno=378.52
+ echo 378.52
+ awk -F. { print $1; }
+ major=378
+ echo 378.52
+ awk -F. { print $2; }
+ minor=52
+ [ 52 ==  ]
+ nvram get buildno_org
+ buildno_org=378.51
+ echo 378.51
+ awk -F. { print $1; }
+ major_org=378
+ echo 378.51
+ awk -F. { print $2; }
+ minor_org=51
+ [ 51 ==  ]
+ [[ 378 -ge 378 -a 378 -lt 378 ]]
+ [[ 378 -lt 378 ]]
+ [[ 378 -lt 376 -o 52 -lt 47 -a 52 -gt 0 ]]
+ [[ 378 -eq 376 -a 52 -eq 0 -a -lt 2678 ]]
[[: 2678: unknown operand
+ [[ 378 -ne 374 -o 52 -ne 43 ]]
+ nvram unset jffs2_log
+ nvram unset DSCP_fix_enable
+ nvram unset rstats_units
+ nvram unset sshd_addr
+ nvram unset log_small
+ exit 0

The line with error is the number 80:
Code:
if [[ $major -lt 376 || $minor -lt 47 && $minor -gt 0 ]] || [[ $major -eq 376 && $minor -eq 0 && $extendno -lt 2678 ]]; then

'extendno' isn't defined.
 
3 suggestions:
  1. In script restore should execute './nvram-excp-merlin.sh' with 'sh nvram-excp-merlin.sh'. In this manner it isn't necessary give execution rights to this script (more secure).
  2. 'jffs-restore.sh' should check if the 'jffs_version' parameter is given, in other case show an error and abort:
    Code:
    [ -z "$1" ] && echo "Error: no directory to restore supplied" && exit 1 || jffs_version=$1
  3. I think that it should save the backup files/folders in a subfolder within of same folder, for example, "backup". This keeps separate backup files of the main scripts.

IMHO, it would have been more appropriate and clear to create a new version with this fix. Or to modify the last zip file with this change. If someone download now the "last" version still has this error. :cool:
Moreover, in first post of this thread there isn't any information about this.
 
Last edited:
yah it probably a good idea to re upload the latest version with the actual fix in and remove the separate file, unless there is a specfic reason to not have the fix in the actual utility
 
yah it probably a good idea to re upload the latest version with the actual fix in and remove the separate file, unless there is a specfic reason to not have the fix in the actual utility
Like everything else in life, my original intent was to do an update shortly afterward, but I got sidetracked. I'm working some updates/enhancements now, and expect to have a new version out in a day or two.
 
Like everything else in life, my original intent was to do an update shortly afterward, but I got sidetracked. I'm working some updates/enhancements now, and expect to have a new version out in a day or two.

Life is like that, none the less I sure the community all thanks you for your creation and work on this :). I know if it wasnt for this utility I would still be using the original merlin fw
 
wow i only just found this.

so this hopefully solves or at least relieves the issue of having to do factory resets whenever changing firmware?
 
wow i only just found this.

so this hopefully solves or at least relieves the issue of having to do factory resets whenever changing firmware?

It totally solves this problem and works quite nicely.

EDIT: The problem of having to manually enter everything that is...
 
Sorry for the long delay between updates.....hope this is worth the wait :)

User NVRAM Save/Restore Utility
LATEST RELEASE: Release 16
16-April-2015
nvram-save-r16.zip
Download http://1drv.ms/16pENHc
===============================
Version 16 (16-April-2015)
Program Changes
  • Add -nouser option to NOT run a configured user exit script
  • Create a nvram-util.log file logging save/restore activity in the working directory
  • New standalone program nvram-restore.sh
  • nvram-restore.sh and jffs-restore.sh will now prompt you to load the last saved backups if run without any input parameters
    NOTE: You can still run the individual nvram-restore-yyyymmdd-macid.sh scripts to perform a restore as in previous releases.
  • The backup files may now be placed in a 'backup' subdirectory. Just 'mkdir /mnt/ASUS/backup' and the files will be placed there instead of in the main working directory.
  • Pass backup directory name to user exit script as second parameter
  • Update fork specific vars for removal on non-fork code
  • Fix runtime error in nvram-excp-merlin.sh (from Release 15a)
  • Update QuickStart guide
INI file Changes
  • Add first pass of TrendMicro module section
  • Add https router access vars
  • Add nat loopback var for Merlin
  • Update DNSFilter section with YanexDNS vars
Full Changelog history is available in the download directory

Some quick usage notes:
  • Although new options/suggested improvements have been added to give greater control during execution, the default operation of the utility has
    not been changed. If you have used the utility in the past, you can continue to use it just like before.
  • A help command has been added to the utility, nvram-save.sh -h
    Code:
    NVRAM User Save/Restore Utility
    nvram-save.sh Version 16
     Options: -h  this help msg
      -v  Print version/perform consistency check
      -b  Backup mode - save for restore to same router (default)
      -m  Migration mode - transfer settings to another router
      -i inifile  Specify custom nvram variable ini file
      -clk  Include clkfreq/overclock setting (Backup mode only)
      -nojffs  Skip backup of jffs storage
      -nouser  Skip execution of user exit script
  • When running the utility or using the print version option, nvram-save.sh, nvram-restore.sh, jffs-restore.sh, nvram-merlin.ini and nvram-excp-merlin.sh are consistency checked to make sure they are all the same version. A WARNING message will be printed on a version mismatch,
    but execution will continue if actually running to generate the restore script.
  • You can now specify a custom nvram variable 'ini' file to use to generate the restore script. A sample ini,
    nvram-sample.ini, is included which is a stripped down version of the full ini containing only basic entries that people
    have mentioned in various threads.
  • The default state is NOT to save clkfreq overclocking values (safest when moving to a new code level). If you wish to
    include this setting, specify the -clk option on the nvram-save.sh command.
  • The nvram-save utility also creates two text files during execution that can be viewed or archived.
    • nvram-all.txt (all nvram variables, including system variables not normally changed by the user)
    • nvram-usr.txt (the nvram variables actually saved by the utility in their save categories)
  • As a reminder, the restore process will make the following changes if moving from a 376 or earlier code to 378 or later
    • A single consolidated MAC filter list will be made from the 2.4 and 5 GHz lists
    • If jffs is not active, it will be set to be activated and formatted, jffs scripting will be disabled
    • If jffs is active, jffs scripting will also be activated
    • If you are using a VPN server, the settings will be migrated to the new nvram variable
    • Moving backwards in code levels will remove those variables that are not present on the target level.
  • The utility is still valid for ASUS OEM as well as Merlin releases.
-----------------------------------------------------------------
SHA256 hash:
Code:
9d7dbadaac93c0c5eb2e2a450810e7746249085403467112ce3be50b850ea195 *nvram-save-r16.zip
Thanks again to everyone for their feedback and suggestions. Enjoy!
 
Sorry for the long delay between updates.....hope this is worth the wait :)

User NVRAM Save/Restore Utility
LATEST RELEASE: Release 16
16-April-2015
nvram-save-r16.zip
Download http://1drv.ms/16pENHc
===============================
Version 16 (16-April-2015)
Program Changes
  • Add -nouser option to NOT run a configured user exit script
  • Create a nvram-util.log file logging save/restore activity in the working directory
  • New standalone program nvram-restore.sh
  • nvram-restore.sh and jffs-restore.sh will now prompt you to load the last saved backups if run without any input parameters
    NOTE: You can still run the individual nvram-restore-yyyymmdd-macid.sh scripts to perform a restore as in previous releases.
  • The backup files may now be placed in a 'backup' subdirectory. Just 'mkdir /mnt/ASUS/backup' and the files will be placed there instead of in the main working directory.
  • Pass backup directory name to user exit script as second parameter
  • Update fork specific vars for removal on non-fork code
  • Fix runtime error in nvram-excp-merlin.sh (from Release 15a)
  • Update QuickStart guide
INI file Changes
  • Add first pass of TrendMicro module section
  • Add https router access vars
  • Add nat loopback var for Merlin
  • Update DNSFilter section with YanexDNS vars
Full Changelog history is available in the download directory

Some quick usage notes:
  • Although new options/suggested improvements have been added to give greater control during execution, the default operation of the utility has
    not been changed. If you have used the utility in the past, you can continue to use it just like before.
  • A help command has been added to the utility, nvram-save.sh -h
    Code:
    NVRAM User Save/Restore Utility
    nvram-save.sh Version 16
    Options: -h  this help msg
      -v  Print version/perform consistency check
      -b  Backup mode - save for restore to same router (default)
      -m  Migration mode - transfer settings to another router
      -i inifile  Specify custom nvram variable ini file
      -clk  Include clkfreq/overclock setting (Backup mode only)
      -nojffs  Skip backup of jffs storage
      -nouser  Skip execution of user exit script
  • When running the utility or using the print version option, nvram-save.sh, nvram-restore.sh, jffs-restore.sh, nvram-merlin.ini and nvram-excp-merlin.sh are consistency checked to make sure they are all the same version. A WARNING message will be printed on a version mismatch,
    but execution will continue if actually running to generate the restore script.
  • You can now specify a custom nvram variable 'ini' file to use to generate the restore script. A sample ini,
    nvram-sample.ini, is included which is a stripped down version of the full ini containing only basic entries that people
    have mentioned in various threads.
  • The default state is NOT to save clkfreq overclocking values (safest when moving to a new code level). If you wish to
    include this setting, specify the -clk option on the nvram-save.sh command.
  • The nvram-save utility also creates two text files during execution that can be viewed or archived.
    • nvram-all.txt (all nvram variables, including system variables not normally changed by the user)
    • nvram-usr.txt (the nvram variables actually saved by the utility in their save categories)
  • As a reminder, the restore process will make the following changes if moving from a 376 or earlier code to 378 or later
    • A single consolidated MAC filter list will be made from the 2.4 and 5 GHz lists
    • If jffs is not active, it will be set to be activated and formatted, jffs scripting will be disabled
    • If jffs is active, jffs scripting will also be activated
    • If you are using a VPN server, the settings will be migrated to the new nvram variable
    • Moving backwards in code levels will remove those variables that are not present on the target level.
  • The utility is still valid for ASUS OEM as well as Merlin releases.
-----------------------------------------------------------------
SHA256 hash:
Code:
9d7dbadaac93c0c5eb2e2a450810e7746249085403467112ce3be50b850ea195 *nvram-save-r16.zip
Thanks again to everyone for their feedback and suggestions. Enjoy!

thank you for your hard work, really handy tool
 
Status
Not open for further replies.

Latest threads

Sign Up For SNBForums Daily Digest

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