How to Backup and Restore Configurations in pfSense 2.0

Updated on November 8, 2016
skear profile image

Sam works as a Network Analyst for an algorithmic trading firm. He obtained his Bachelors Degree in Information Technology from UMKC.

I always like to backup the configuration of my pfSense system before I do any major changes to the system. If I ever run into a problem I can always reinistall pfSense from the CD and restore the backup file. This makes the process of recovering from a problem much faster and a lot less of a hassle than the alternative of rebuilding everything from scratch.

Even when I'm not planning a major change such as an upgrade I like to make an occasional backup of the configuration. I tend to make many small tweaks to my pfSense systems over time and I don't always remember everything that I have done.

I've also had instances in the past where the hard drive in my router randomly decided to stop working and I was forced to restore from backups, so it's a good idea to always be prepared.

Performing a Manual Backup

To perform a backup of the system configuration click on backup/restore in the diagnostics menu. Make sure the backup area is set to "ALL", then click on download configuration. This will download an xml file which contains all of the configuration settings stored within pfSense.

Other Options

  • Do not backup package information - I usually leave this box unchecked so I can restore the settings for the packages that are installed. If you need to migrate a configuration to another system without the same packages you might need to use this option.
  • Encrypt this configuration file - It is always a good idea to enable encryption on the config file. Passwords are stored in plain text within the xml file so be careful! If you enable this setting you will have to set a password for the file.
  • Do not backup RRD data - This setting is enabled by default and most users will want keep it turned on so the backup files remain small in size. If you do want to backup the data for the graphs within pfSense disable this setting.

Click thumbnail to view full-size
The backup and restore page can be found in the diagnostics menu.To do a full backup set the backup area to "ALL" and click on download configuration.If you want to do a partial backup you can select an individual area.
The backup and restore page can be found in the diagnostics menu.
The backup and restore page can be found in the diagnostics menu.
To do a full backup set the backup area to "ALL" and click on download configuration.
To do a full backup set the backup area to "ALL" and click on download configuration.
If you want to do a partial backup you can select an individual area.
If you want to do a partial backup you can select an individual area.

Automatic Backups

If you manage several pfSense firewalls you might want to consider using the automatic config backup package. To take advantage of this package you must be a pfSense premium portal subscriber.

Once you install the package you will need to enter your support portal username and password. To access the package settings click on AutoConfigBackup in the diagnostics menu.

After you configure the package it will monitor the system for changes. Any time the pfSense configuration is changed a backup of the configuration will be encrypted and transferred to an off-site backup server.

Click thumbnail to view full-size
The auto config backup package can be installed using the package manager.To use the auto config backup service you must have a pfSense support subscription.
The auto config backup package can be installed using the package manager.
The auto config backup package can be installed using the package manager.
To use the auto config backup service you must have a pfSense support subscription.
To use the auto config backup service you must have a pfSense support subscription.

Remote Backups Via SSH

If you don't have a support portal account you can still set up automatic backups.

Every time a change in pfSense is made a backup of the config file is stored in /cf/conf/backup.

You could create a script to run as a cron job on the pfSense system to push the files in this directory to a remote server or network attached storage device.

Or you could also run a script on a remote system which could download the files in the config directory using SSH/SCP.

Click thumbnail to view full-size
Every time a config change is made a backup is created in /cf/conf/backup.Previous config files can be viewed in the web gui by clicking on backup/restore in the diagnostics menu.
Every time a config change is made a backup is created in /cf/conf/backup.
Every time a config change is made a backup is created in /cf/conf/backup.
Previous config files can be viewed in the web gui by clicking on backup/restore in the diagnostics menu.
Previous config files can be viewed in the web gui by clicking on backup/restore in the diagnostics menu.

Performing a Restore

Config files can be restored from the same page you create the backups on. You have the option of selecing a specific area of the config to restore, or "ALL" for a full restoration.

Choosing an individual area is useful in situations where a firewall or nat rule has been deleted but the rest of the system is still fine.

After the config file is restored pfSense will reboot automatically.

Config files can be restored from the same page as they are created on.
Config files can be restored from the same page as they are created on.

Best Practices

I highly recommend setting up a system for automatically backing up your config files. When backups are automated you don't have to worry about remembering to do them.

Make sure to store your config files in a different physical location than the router or firewall you are backing up. In the event of a fire or flood the backup will be useless if it was destroyed along with the system being backed up.

Dropbox offers 2GB of offsite storage for free, making it a perfect location for storing config files.

Questions & Answers

    © 2011 Sam Kear

    Comments

      0 of 8192 characters used
      Post Comment

      • profile image

        gre 

        3 years ago

        How do you restore from the cf/conf/ folder?

      • skear profile imageAUTHOR

        Sam Kear 

        4 years ago from Kansas City

        @rasco

        If you're moving to different hardware you will need to re-run the interface assignment wizard on the new machine after you have restored the configuration.

        This can be done directly from the console of pfSense.

      • profile image

        racso 

        4 years ago

        mmmm i think ... this document ommitted says that : if you have a BOX A, with a config and this hardware box a failssss.....then when you get another diferent box "BOX B"...and install iso pfsense , you can install xml file but (paste)... and here comes that i detect was ommited...that's config has a different name to your nic cards....and then if you renamed your still not working at all...i tested tested and allways have the same ....pass my config = ok , but not working like my another box A (not route not get goes to internet )

        any one knows how solve restore into diferents hardware......

      • profile image

        Jared 

        5 years ago

        great write up! There is now a $99/yr Gold Subscription that gives you access to the Auto Config Backups. https://portal.pfsense.org/gold-subscription.php

      • profile image

        Ben Tyger 

        5 years ago

        I have started an open-source project deal with pfSense 2.0 automatic backups. You can find it at http://code.google.com/p/pfsense-backups/

      • skear profile imageAUTHOR

        Sam Kear 

        7 years ago from Kansas City

        Hey tamron,

        Thanks for your comment! You might want to consider removing the hard drive from your old computer and connecting it to a working one with a usb adapter. Maybe I should make a hub about that ;)

      • tamron profile image

        tamron 

        7 years ago

        Great Info. on Backup on in pfSense 2.0! I have an old spare computer I tried to backup and save to hard drive. I get black screen with Press F11 to start recovery NTLDR is missing Press Ctrl+Alt+Del to restart. I keep getting an error message still haven't fixed the problem.

        Great Hub! Vote up & Ping Ya!

      working

      This website uses cookies

      As a user in the EEA, your approval is needed on a few things. To provide a better website experience, turbofuture.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

      For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://turbofuture.com/privacy-policy#gdpr

      Show Details
      Necessary
      HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
      LoginThis is necessary to sign in to the HubPages Service.
      Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
      AkismetThis is used to detect comment spam. (Privacy Policy)
      HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
      HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
      Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
      CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
      Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
      Features
      Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
      Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
      Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
      Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
      Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
      VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
      PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
      Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
      MavenThis supports the Maven widget and search functionality. (Privacy Policy)
      Marketing
      Google AdSenseThis is an ad network. (Privacy Policy)
      Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
      Index ExchangeThis is an ad network. (Privacy Policy)
      SovrnThis is an ad network. (Privacy Policy)
      Facebook AdsThis is an ad network. (Privacy Policy)
      Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
      AppNexusThis is an ad network. (Privacy Policy)
      OpenxThis is an ad network. (Privacy Policy)
      Rubicon ProjectThis is an ad network. (Privacy Policy)
      TripleLiftThis is an ad network. (Privacy Policy)
      Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
      Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
      Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
      Statistics
      Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
      ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
      Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)