This is an old revision of the document!
pfSense - Restore a pfSense Backup using the CLI (Command Line Interface)
Requirements:
- A usb drive formatted as FAT32.
- A backup of your pfSense Config File on the USB drive.
Have pfSense installed.
Boot up to the pfSense CLI.
Plug the USB device into the system.
NOTE: This should display some messages showing device id, something like da0.
- But it is prudent to double-check this.
Select Option 8 (Shell).
Run the command:
camcontrol devlist
NOTE: This should show the USB drive. * Here it confirms that the USB is da0. </WRAP> List the available partitions on the USB. <code bash> ls /dev/da0* </code>
NOTE: This might only show a single partition /dev/da0s1.
Mount this partition.
NOTE: It needs to be mounted against a directory. * Either use an existing directory, or create a new directory: <code bash> mkdir /media/bak </code> </WRAP> <code bash> mount_msdosfs /dev/da0s1 /media/bak </code> List the files that are on the USB drive: <code bash> cd /media/bak ls </code> Copy the pfSense backup file to /cf/conf/config.xml overwriting the default config file. NOTE: First make a backup of the default config file: <code bash> cp /cf/conf/config.xml /cf/conf/config.bak </code> <code bash> cp /media/bak/pfsensebackup-202008131210911.xml /cf/conf/config.xml </code>
NOTE: This will copy the backup file into the /cf/conf directory and will rename the file to config.xml overwriting the file that is currently there.
Remove the temp file and reboot the system. <code bash> rm /tmp/config.cache </code> Exit the Shell <code bash> exit </code> Root, by selecting option 5 (Reboot system)
NOTE: After the reboot, the configuration should be applied if there were no issues or compatibility issues.