Posted: Tue Jun 10, 2008 0:26 Post subject: Re: settings backup conversion tool?
yugiohdan6 wrote:
since the setting backup files can't be restored from version to version how about a conversion tool?
i'd imagine it can't be THAT hard to make... (this coming from someone who generally sucks at programming in anything other than vb.net)
Yeah... File format is simple... File header is "DD-WRT" then two bytes which is short int and means number of saved records, after that records of saved parameters from NVRAM, format is next:
1. one byte (binary) - length of parameter name
2. parameter name - ASCII text, name its self
3. two bytes (binary) - length of parameter value
4. parameters' value - always ASCII text
Note: if not value exists, then field 3 will be 0x00 0x00 and field 4 will not be exist (sure, because it's zero length).
So, format has not been changed during all of the versions because it is just simple ANSY C style array class save method.
Difference between versions (as well between builds as mini, standard, VoIP, VPN, etc) is data it's self - NVRAM parameters. So, if you prety sure about list of NVRAM parameters and difference between versions you may make this converter in VB as well ;)
But, really I see unusable to make converter between mini and standard or v23 and v24... Any where should be counted dependencies of build and revision features...
Yes, during upgrade it is reasonable but here is question as well - for what? I have upgraded wrt from v23SP2 to v24RC7 and did not have any issues when left "Don't reset parameters"... _________________ WRT54G v8.2 x 1, WRT54GL v1.1 x 3, WAP54G v3.1 x 6
DD-WRT v24 build 11296M NEWD Eko
ChilliSpot,FreeRADIUS
Joined: 04 Jan 2007 Posts: 11564 Location: Wherever the wind blows- North America
Posted: Tue Jun 10, 2008 0:53 Post subject: Re: settings backup conversion tool?
yugiohdan6 wrote:
since the setting backup files can't be restored from version to version how about a conversion tool?
i'd imagine it can't be THAT hard to make... (this coming from someone who generally sucks at programming in anything other than vb.net)
Unfortunately, it is that hard to make. From RC to RC build there were different nvram variables....from V23, v23 sp1, v23 sp2 and v23 sp3 then to v24 there were different nvram variables....it is impossible to come up with every combination of build to build for an nvram conversion.
It has been policy and still remains policy that if you are upgrading/downgrading firmware.....hard reset before and after each firmware load to clear the nvram variables before configuring.
It only takes an extra 3 minutes to clear them out (90 seconds before and 90 seconds after) to ensure you have a good firmware flash.
redhawk _________________ The only stupid question....is the unasked one.
Posted: Tue Jun 17, 2008 20:58 Post subject: Re: settings backup conversion tool?
redhawk0 wrote:
It only takes an extra 3 minutes to clear them out (90 seconds before and 90 seconds after) to ensure you have a good firmware flash.
Its not the time to do the hard reset, its the time required to reconfigure all the settings and making sure you have remembered all of them (for those of us who keep poor records).
Just having a way to convert the settings file to simple readable text would be helpful to use as a roadmap when going through the configuration, so I think I'm going to try to whip one out. _________________ WRT54GL modded to 32MB DRAM and 16MB Flash.
Congratulation AND THANKS A LOT, great Tool and nice working.
If someone gets an error msg during starting the prog (Win2kSP4) about missing COMDLG32.OCX, do the following:
1. download attaced file
2. extract comdlg32.ocx to %Systemroot%\System32 folder
3. type the following command from Start, Run dialog:
Code:
regsvr32 %Systemroot%\System32\comdlg32.ocx
You should see the following message:
DllRegisterServer in C:\WINDOWS\System32 \comdlg32.ocx succeeded.
Here's a quick update to fix some minor problems (settings longer than 1024 characters were being truncated) and a couple new features.
1. Multi-line settings (like rc_startup) have line feeds replaced by a caret (^) in the CSV file, both for readability and editing (see #2)
2. I've added routines to convert a CSV back to a bin file.
In theory, you should be able to:
1. Backup your existing settings
2. Convert them to CSV
3. Upgrade to a new version
4. Create a new (default) NVRAM backup to capture all the variable names and make a new CSV.
5. Using a text editor cut and paste important settings from your old CSV to the new CSV
6. Convert the new CSV back to a bin file, upload it to your router and have your pre-upgrade settings recovered.
I have NOT tested this completely, but (with my one bin file) I have verified round trip conversion (bin->csv->bin) results in an identical bin file to what came off the router.
Proceed with caution since there has been only minimal testing done and let me know if you find anything that breaks it.
dd-wrt_nvram2csv.zip
Description:
Version 1.1 adds bin file creation from a CSV file
So I will do test it tomorrorw. Thanks.
Here a quick idea: How do you think about a 2nd vertical window, to compare two loaded configurations inside the tool and scroll it down parallel? If the parameter lines are identical, the background color should be light green. If this parameter in one configuration missed or not set, the background color should be light yellow and finally if the parameters are different, e.g. different IP adresses, the background color should be light red. So it should be possibel to compare changed parameters between two different backuped settings in changed firmewares. The next advance: If someone administrate a whole pool of WRT's, he can make very easy some clones, only changeging the target parameters like IP addresses.
Note: if not value exists, then field 3 will be 0x00 0x00 and field 4 will not be exist (sure, because it's zero length).
So, for example, if you are on a cable modem with DHCP you (probably) wouldn't have a ppoe_username valuein your NVRAM settings.
The variable will be defined, but it will have a null value.
So, if a variable has field three (length of setting) set to 0x0000 (zero length, not defined) then field four (the actual value for the variable) does not exist. I flag this case with the "Not Set" since there is no value present.
A "default" value is not necessarily "Not Set" (ie. "chilli_interface" defaults to "wan" even if chilli is disabled).
Adding a comparison feature could easily be beyond my pitiful skills, not to mention VB6's data manipulation capacity.
Not to mention, I have but one WRT54 so comparisons are going to come up with minimal differences. Still, we'll see what comes to pass. _________________ WRT54GL modded to 32MB DRAM and 16MB Flash.
Thanks for clearing that up. I guess my question was whether or not "Not Set" indicated that that particular parameter was at its default (null) value, which from your explanation sounds like it is, but please correct me if I'm wrong. Also, for the fields that are completely blank (without "Not Set"), then are those values null as well?
"Not Set" means there is no value.
If the default (for example, static dhcp clients)is null (no static clients) then the variable will be "Not Set".
If the default (for example, snmpd_enable) is something (disabled in this case) then there will be a value in the CSV file for the variable (0 in this case, since 0 denotes disabled).
Does that make sense? _________________ WRT54GL modded to 32MB DRAM and 16MB Flash.
Posted: Thu Apr 22, 2021 15:56 Post subject: Thread back from the Dead
Hi all,
I was hoping this tread could be revived but in any case I plan to use this tool with beyond compare, so I can find what setting I'm missing in my config that breaks something I need. Anyway try beyond compare with the CSV converted and you should be able to see what setting you forgot to set.
Update: Comparing via beyond compare wont work because the lines move between builds so its impossible to get a good comparision of what is really different.
Update 2: I may have found a way to re-align the differences in the CSV, in beyond compare there is a setting under rules alignment and you can match by closeness. It takes the lines and matches them back up. I am checking to see if I can then copy from one side to the other without messing up the file. Will see.
You could look into the nvram-save utility which is included with easyddup. It creates human readable/editable text backups. Full or partial settings can be restored.
You could look into the nvram-save utility which is included with easyddup. It creates human readable/editable text backups. Full or partial settings can be restored.