User Tools

Site Tools


pfsense:restore_a_pfsense_backup_using_the_cli_command_line_interface

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.

List the available partitions on the USB.

ls /dev/da0*

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:
    mkdir /media/bak
mount_msdosfs /dev/da0s1 /media/bak

List the files that are on the USB drive:

cd /media/bak
ls 

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:

cp /cf/conf/config.xml /cf/conf/config.bak
cp /media/bak/pfsensebackup-202008131210911.xml /cf/conf/config.xml

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.

rm /tmp/config.cache

Exit the Shell

exit

Root, by selecting option 5 (Reboot system)

NOTE: After the reboot, the configuration should be applied if there were no issues or compatibility issues.

pfsense/restore_a_pfsense_backup_using_the_cli_command_line_interface.txt · Last modified: 2022/03/03 11:37 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki