General Category > General Discussion

Restore previus configuration from USB

(1/2) > >>

I was working around with the file editor over web GUI (Pfsense version 2.3.5) make it some changes. I make a mistake and the system show me a error and i couldn't enter again. So, i tryed to fix the problem by restore a backup made it previusly before start working on the config file (this is important guys, do a backup everytime you want to change some in any system  :)). Several minutes later and trying many methods i couldn't restore my system, mostly becouse the backup file was in a usb drive and the installation program show me several errors trying to restore the config.xml. By the way, even using the Restore to factory default i wasn't able to restore my box. After think for a minute, this was the method that work for me. Maybe is not the most elegant but, it works pretty good :)
1-. Conect your usb drive with the file .xml. Then enter the shell (option 8 )
2-. Find out the device with ls /dev/da*. Probably it's looks like da(x)s(x).
3-. Mount the drive. I created a directory on /home with mkdir (something  like mkdir /home/usbdrive)
4-. Go to the USB drive via cd /home/usbdrive/<directory_where_the_file_is>
5-. Type cp <name_of_the_file>.xml /cf/conf
6-. Go to /cf/conf/ and using vi open the file config.xml. "vi config.xml"
7-. Press Shift + q. When the ":" appears type "write config_old.xml" (This make a copy of the original config.xml, just in case)
8-. Now open the backup file with vi. Press Shift + q, and when the ":" appears type "write! config.xml". (Overwrite the config.xml)
9-. Then reboot the system with "reboot" command.

And thats it. Your system should run normaly again.

I would like to know is there is a more easly way to restore a config.xml.

PS: As you probably notice, i'm not a Linux/Unix user. I toke some minutes to find out the commands to do this.
PS2:  This method allow you to enter to configuration web gui. But, i saw that if you try to change anything using edit file and click on "save", the changes are not saved. So, once you successfuly log in in the configuration gui, you may make a restore using a previus backup. 


Perhaps you should post your question in one of the support forums, General Questions maybe?

Is not a question really, i'm just sharing a solution to a problem i haved. But, if any one want to share a better idea how to solve this kind of issues are welcome.  :)

"I would like to know is there is a more easly way to restore a config.xml. "

If your at the console or ssh you can just restore previous config from there.. It will list time and date of config change and pick one before you messed up the config... I would not suggest editing the xml file directly btw..

In fact i tried that method, but the error in the config file would't let me use it.

And yes, is a very good advice dont work around with the config.xml. But, is important know the file and know how to work with it, because in some scenarios, is the best way to achive time saving.  :)


[0] Message Index

[#] Next page

Go to full version