Restore config.xml



  • I have had psfense as my firewall for a couple of years and with nothing better to do I messed with some settings and now cannot access the webgui.  I have copied the backup config from my Windows system to a fat formatted USB.  Connected a monitor, keyboard and mouse to the system and at bootup can access the shell.  Just need help with the commands to replace the current config with the backup.  Thanks.



  • Sorry I should of read your question more clearly earlier, have you mounted the USB in pfsense yet? if not after you plug in the USB drive in your system, run

    dmesg
    

    Look for information about what the device is assigned, i.e /dev/da0 or da1

    You can confirm the device is in /dev

    ls -l /dev
    

    Look for da0/1 or similar and report back and then I can help you mount the device and copy the backup config over to the firewall.

    Just out of curiousity, what version of pfsense do you use? if its not too old there is a directory in /conf/backup that holds recent backed up configs so you could easily just copy one of those down a directory.

    –---------------------------------------------------------------
    I do that all the time, break perfectly working things :0)

    copy the config file to /conf/config.xml

    Dont forget to backup the old config.xml in that directory JIC



  • Or you can go via hard way: documentation



  • Thanks for your reply.  I am on v2.0.1 and haven't attempted anything yet.   The latest backup I have on USB is 11/15/12.  I have made changes in DHCP reservations since the last backup but I always keep a screen shot of these for my records.  Would greatly appreciate your help in copying the config in conf/backup to conf/config.xml.  I have searched on the commands to use but I don't want to screw it up.  I would like to avoid going the hard way or restoring an older image of the system I made with Acronis if possible.   Again, thanks.



  • Use a ssh client like http://www.chiark.greenend.org.uk/~sgtatham/putty/

    Or directly with the firewall infront of you with keyb and monitor….

    Connect to you firewall and login, choose option 8 (Shell)

    Then

    cd /cf/conf/backup
    

    Now youre in the config back up directory, see what files are listed

    ls -l
    

    You should see a lots of config files named "config-xxxxxxxxxx.xml", look at the timestamp on those files, its for you to determine which file to copy based on when you fudged up the settings, if youre happy with your choice, run

    cp config-xxxxxxxxxx.xml ../
    

    The above should copy the config file to /cf/conf, we'll drop down to this directory and then backup your old config just in case, then we'll move the 'working' config in place of the old config thats giving you trouble.

    cd ..
    cp config.xml config.xml.backup
    mv config-xxxxxxxxxx.xml config.xml
    

    You should be done, just type exit in the console, the console menu should come up, then choose option 5 (reboot) sit back and pray.


Locked