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
    7 Posts 4 Posters 257 Views
    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
      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
        SteveITS Galactic Empire @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

        Pre-2.7.2/23.09: 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 restart, or more depending on packages and device speed.
        Upvote 👍 helpful posts!

        W 1 Reply Last reply Reply Quote 0
        • W
          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
            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
              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
                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
                  Wolfgangthegreat @patient0
                  last edited by

                  @patient0 Thanks!

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