Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Restore backup file from the console CLI

    Scheduled Pinned Locked Moved General pfSense Questions
    8 Posts 5 Posters 294 Views 6 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W Offline
      Wolfgangthegreat
      last edited by

      Hello,

      Is there a way to replace the config by uploading the backup XML file via the console CLI?

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        SteveITS Rebel Alliance @Wolfgangthegreat
        last edited by

        @Wolfgangthegreat Yes you can edit the file:

        https://docs.netgate.com/pfsense/en/latest/config/xml-configuration-file.html#edit-in-place

        Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
        When upgrading, allow 10-15 minutes to reboot, or more depending on packages, and device or disk speed.
        Upvote 👍 helpful posts!

        W 1 Reply Last reply Reply Quote 0
        • W Offline
          Wolfgangthegreat @SteveITS
          last edited by

          @SteveITS Thank you

          1. But this looks like editing from the GUI, or is it access from the console "shell" menu command?
          2. Is there an editor at the console that is nicer than vi, like nano?
          3. Is enabling a rule in the config is by removing the <disabled></disabled> in the rule?
          1 Reply Last reply Reply Quote 0
          • stephenw10S Offline
            stephenw10 Netgate Administrator
            last edited by stephenw10

            You can use vi (if you must!) but the easy editor, ee, is also included.

            If you just need to revert a change you can just roll back the config to a previous version from the console menu.
            https://docs.netgate.com/pfsense/en/latest/config/console-menu.html#restore-recent-configuration

            If you need to upload a different config consider using the external config locator which requires only having the config file on a USB stick:
            https://docs.netgate.com/pfsense/en/latest/backup/restore-during-install.html#restore-using-the-external-configuration-locator-ecl

            W 1 Reply Last reply Reply Quote 1
            • W Offline
              Wolfgangthegreat @stephenw10
              last edited by

              @stephenw10 Thanks.

              I cannot upload using USB as it is a remote VM.

              What about - "Is enabling a rule in the config is by removing the <disabled></disabled> in the rule?"

              patient0P 1 Reply Last reply Reply Quote 0
              • patient0P Offline
                patient0 @Wolfgangthegreat
                last edited by

                @Wolfgangthegreat said in Restore backup file from the console CLI:

                What about - "Is enabling a rule in the config is by removing the <disabled></disabled> in the rule?"

                Removing <disabled></disabled> from the config.xml and reboot does work. Reboot is necessary because the change seems not to be applied to the system but only to the GUI.

                It seems @luckman212 created a PHP script to do it without the reboot: List or toggle rules on/off via CLI.

                W 1 Reply Last reply Reply Quote 0
                • W Offline
                  Wolfgangthegreat @patient0
                  last edited by

                  @patient0 Thanks!

                  luckman212L 1 Reply Last reply Reply Quote 0
                  • luckman212L Offline
                    luckman212 LAYER 8 @Wolfgangthegreat
                    last edited by

                    @patient0 just a quick note, I updated that script to operate correctly on newer versions of pfSense (2.8/25.07). Let me know if you run into any issues.

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.