1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Backup/Restore

Discussion in 'Tomato Firmware' started by vamichael, Oct 8, 2007.

  1. vamichael

    vamichael LI Guru Member

    Does this feature allow you to save your settings to a file and then restore them?

    I would like to be able to load my settings onto a different router. What I did was saved my settings to a gz file, loaded the same firmware on the new router, then loaded the settings, but the settings did not appear.

    Am I doing something wrong?
     
  2. DigiH

    DigiH Network Guru Member

    Hi vamichael,

    I suppose you are talking about the Administration - Configuration Backup and Restore options?!? Is so, yes that's what those options are for.

    Any chance you are using Safari for accessing your router? With the last Tomato 1.09 update I found that when doing a backup of the configuration with Safari you wrongly get a .gz file, where the download should be a .cfg. Switching over to Firefox gave me the proper file format which you can then upload to another router so that everything should work as expected.

    I hope this helps
     
  3. GeeTek

    GeeTek Guest

    Historically the .cfg files created by Tomato could only be used for that same exact radio. I'll try it again on the new Tomato One dot One and post back if it has changed.
     
  4. vamichael

    vamichael LI Guru Member

    It gave me a .gz file, not a .cfg. That could be the problem.
     
  5. roadkill

    roadkill Super Moderator Staff Member Member

    backup/restore .cfg issues due to a content type typo is fixed in v1.10
     
  6. GeeTek

    GeeTek Guest

    But are still worthless for what the OP wants to do.:wall:
     
  7. GeeTek

    GeeTek Guest

    Something tells me that your advice will not help. Maybe it has something to do with the Tomato error message that states "You cannot restore settings to a different router" !

    Edit - If you try, this is the error you get...http://www.dslreports.com/forum/r19219719-Virgin-11-Ohhh
     
  8. roadkill

    roadkill Super Moderator Staff Member Member

    nevertheless I think it will work if you change mac addresses to default
    could probably make the modification to default the mac address instead of showing the warning.
    BTW: do all Tomato version have this limitation because I think I did it at some point.
     
  9. GeeTek

    GeeTek Guest

    Default ? No. I even cloned the 2 menu clonable MACs from the radio that produced the cfg file into the second radio, and it still gives the error.

    Yes, they all have this limitation, and no, you must be thinking of someting else. This has been a snag since day 1. On my next big install, it would be nice to have work around. Maybe some code monkey can figure out why Jon has this limitation, and will find a good way around it ! While we are at it, adding WAN port to switch when WAN is disabled (Like dd-wrt can do) would be worth some donation money, hint hint.....
    Money in, money out.
     
  10. roadkill

    roadkill Super Moderator Staff Member Member

    Here is the check at nvram.c which compares MAC addresses to a value in the .cfg file and if not equal denies the restore.

    Code:
    *bv = 0;
    		if (strcmp(bk, "et0macaddr") == 0) {
    			if (!nvram_match(bk, bv + 1)) {
    				if (!force) {
    					printf("Cannot restore on a different router.\n");
    					return 1;
    				}
    
    this can be easily changed to default the MAC address if not equal instead...
     
  11. GeeTek

    GeeTek Guest

    Damn ! That right there is almost enough to force me to learn *Nix !
    Since I speak only BASIC, what would happen if you re-compiled with ;

    Code:
    *bv = 0;
    		'if (strcmp(bk, "et0macaddr") == 0) {
    			'if (!nvram_match(bk, bv + 1)) {
    				'if (!force) {
    					'printf("Cannot restore on a different router.\n");
    					'return 1;
    return 0;
    Echo "If you just restored to a different model, you just hosed yer radio! Press any key to continue...."
     
  12. GeeTek

    GeeTek Guest

    The MAC address in question is obviously the "Router's MAC Address:" which cannot be changed from Tomato's GUI.
     
  13. roadkill

    roadkill Super Moderator Staff Member Member

    maybe I'll add a small patch to nvram.c in the Mod, I hope to be posting a new version which includes SD/MMC support in a week.
    BTW: you simply need to reset the variable to default using the compare test value.
    or change compare function to only use half of the mac address that way it won't restore settings on different radios
    since the first 3 octets in the mac address define the manufacturer
     
  14. GeeTek

    GeeTek Guest

    Flexability is the key to real success. The folks who use Tomato and other alternate firmware are not the average consumer. The average consumer buys a $55 dollar WRT at Walmart, plugs it in and enjoys wireless access on Ch6 with SSID = Linksys and no encryption. It is a mistake for alternate firmware developers to think they will compete with or replace the needs of that market. This is a niche market. Options and applicability is where the money is at.
     
  15. roadkill

    roadkill Super Moderator Staff Member Member

    restoring config on different router
    Code:
    nvram restore <filename> [--force] 
    take care with different models this is dangerous and could have unexpected results
    you have to reset mac address to default afterwards to use the feature via the web interface use this in your init script
    Code:
    ln -s "/bin/nvram --force" "/tmp/nvram"
    
    then nvram will be issued with the force parameter automatically.
     
  16. GeeTek

    GeeTek Guest

    So, and extra line of code and a check box to enable the opion if desired is all I need to work into the code so it will work from the gui. Hello Jon ? Heloooo ?? Maybe I'm the only one who could use the feature. Sure would be nice to have backup configs of critical radios that I could use to slam into a replacement radio and plug right in. They get stolen about as often then they burn up. I guess the home user with one radio really would not need this very much. I just hate being protected from myself. Thanks RoadKill, I will use it.

    Edit - Be sure to let us know if you work this into your VPN version. I use a lot of radios and they are part of a steady revenue stream.
     
  17. roadkill

    roadkill Super Moderator Staff Member Member

    I can add this in root prepare script but I wouldn't this could have bad consequences perhaps a check box conditional with nvram value, would it do?
     

Share This Page