How does the nvrambak.bin restore process actually work?

4 posts / 0 new
Last post
WolverineFan's picture
How does the nvrambak.bin restore process actually work?

Hoping someone can help me with this.  What I want to know is if restoring an nvrambak.bin backup file wipes the existing nvram and then replaces it with the contents from the file, or if the contents of the file are merged in.

The reason I'm asking is I'd like to be able to backup/restore a very small subset of the router settings (static lease list, IP address ranges, selected wireless settings, etc) instead of everything.  I noticed that the nvrambin.bak file is fairly editable, so I can pull out some stuff (static leases for instance) very easily.  If the "restore" process reads the file and replaces existing entries with the ones from the file, I'm good.  If the restore process deletes all existing settings and uses only the ones in the file, I'd wind up with a pretty messed up router.

Obviously I'm hesitant to try it out since it could do bad things.

Also, if anyone has a better way to selectively restore certain settings like the ones listed above, that would be great to know!  I'm posting this for DD-WRT since that's what I'm currently using, but I'm willing to consider a different firmware if this is a feature of one of the others.


WolverineFan's picture
Oh, and if there's a command

Oh, and if there's a command-line way but not GUI way that's fine too. I don't mind a command-prompt :)

WolverineFan's picture
To answer part of my own

To answer part of my own question, I finally found this (Honestly, I searched before posting :) )

I'll have to give it a shot. Looks usable, but if anyone knows of anything even easier that would be nice.

Subhra's picture
As per my knowledge, whenever

As per my knowledge, whenever we restore a "nvrambak.bin" file, all the current existing nvram configurations are reseted(removed) and then are replaced with the ones in "nvrambak.bin" file.

One information I want to convey that you can set value of nvram parameters in the router using the following commands,
"nvram set name=value" (e.g. nvram set wan_proto=dhcp).
"nvram commit" (commits the changes finally).

So, for your case, you can create a script containing a series of such commands to set your desired value against various nvram parameters, and last commiting them finally.
Transfer the script to your board(using scp or ftp) and by simply running it will result in changing the nvram parameter values to your desired one.