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

    help to recover config.xml

    Scheduled Pinned Locked Moved Problems Installing or Upgrading pfSense Software
    8 Posts 3 Posters 1.1k 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.
    • 4
      4o4rh
      last edited by

      i had a power failure and my system wouldn't come back up.

      I used the recover config installation process, which worked to the extent it copied the config.xml to the /tmp/recovery folder and installed it on the new install.

      Unfortunately, booting failed due a bunch of missing php so files.
      i went in via the shell and made a backup copy of the config.xml but unfortunately, using the factory reset option wiped it. The last auto-backup file from a week ago seems to be corrupt.

      will a copy of the config.xml still be in the tmp folder of the flash drive?
      if so, how can i mount it to recover the file?

      1 Reply Last reply Reply Quote 0
      • JeGrJ
        JeGr LAYER 8 Moderator
        last edited by

        @gwaitsi said in help to recover config.xml:

        Unfortunately, booting failed due a bunch of missing php so files.

        If that's the case either you didn't really reinstall or the installation (medium) was buggy. After a clean reinstall, there's no way there are PHP .so failures.

        will a copy of the config.xml still be in the tmp folder of the flash drive?

        while installing, the /tmp IMHO is a RAMdisk drive, no real folder on your stick as it's only needed while the installation process is ongoing, then it is copied over to the final /conf/ location. So no, it I don't assume it will be there.

        The last auto-backup file from a week ago seems to be corrupt.

        Which kind of auto-backup and why do you assume it is "corrupt"? Never seen very very seldomly seen a config corrupted. Truncated to 0 or truncated in half etc. but actually corrupted as to what?

        Also: if it copied over the config.xml to the system and you got it running one time - why not boot it back again (yes it's reset now) and check the "restore config" option? Normally even after a factory reset the old configs from the config history trail are still there and you can go to an older version?

        cheers
        \jens

        Don't forget to upvote ๐Ÿ‘ those who kindly offered their time and brainpower to help you!

        If you're interested, I'm available to discuss details of German-speaking paid support (for companies) if needed.

        4 1 Reply Last reply Reply Quote 0
        • 4
          4o4rh @JeGr
          last edited by 4o4rh

          @JeGr yes, the auto backup (to netgate) says the last backup (6th sept) is 0 or corrupt, the one before that worked.

          I guess it is because restoring the config, didn't restore the modules that were installed.

          i.e. during boot there was a message pfblockerng.sh couldn't be found

          they were all php related
          20131226/sysvsem.so.so
          20131226/sysvshm.so.so
          20131226/tokenizer.so.so
          20131226/xml.so.so
          20131226/xmlwriter.so.so
          20131226/zlib.so.so
          20131226/pdo_sqlite.so.so
          20131226/xmlreader.so.so

          i wasn't able to do a force pkg update. i tried reinstalling by recovering the config 4 or 5 times and tried forcing reinstall of the packages, but it wasn't able to.

          then i run rc.initial which go the system up instantly. although i recovered the config from two weeks ago, i had to manually re-install snort, pfblocker and system patches. and of course, i had to restore local.conf.loader.

          i would say a feature improvement would be to

          1. automatically restore any packages that were installed
          2. backup all custom files and not just config
          1 Reply Last reply Reply Quote 0
          • JeGrJ
            JeGr LAYER 8 Moderator
            last edited by

            @gwaitsi said in help to recover config.xml:

            i wasn't able to do a force pkg update. i tried reinstalling by recovering the config 4 or 5 times and tried forcing reinstall of the packages, but it wasn't able to.

            Do you/did you have problems with your WAN? After restoring a config and with configured WAN, there should be no problem after a reboot for pfSense to restore all installed packages. Otherwise something may be wrong with the WAN config or your firmware/package versions.

            automatically restore any packages that were installed

            That IS done automatically in a normal restore. I've done it mutiple times for various customers, so that's how it already works. If it doesn't for you then there's something amiss or buggy somewhere.

            backup all custom files and not just config

            What custom files are you talking about? The file is named loader.conf.local and only created if you need it. If you want it to survive a reinstall/reimage, then create it with the "Filer" package which takes care of saving its content in the config.xml to be reinstated after a restore of the config.

            Cheers
            \jens

            Don't forget to upvote ๐Ÿ‘ those who kindly offered their time and brainpower to help you!

            If you're interested, I'm available to discuss details of German-speaking paid support (for companies) if needed.

            4 2 Replies Last reply Reply Quote 0
            • 4
              4o4rh @JeGr
              last edited by

              @JeGr after install, the WAN and IPs were up, but i had to create a temp resolv.conf to get dns to work.

              Will have a look at the filer package. thx

              1 Reply Last reply Reply Quote 0
              • 4
                4o4rh @JeGr
                last edited by

                @JeGr there is no longer docs for filer. links just take you to current netgate package list, which does not include filer.

                are you saying, i just add to the below to the files list

                /boot/loader.conf.local 0644 Custom Boot Loader File

                and it will then be included in the config.xml for auto restore later on?

                1 Reply Last reply Reply Quote 0
                • JeGrJ
                  JeGr LAYER 8 Moderator
                  last edited by

                  @gwaitsi said in help to recover config.xml:

                  @JeGr there is no longer docs for filer. links just take you to current netgate package list, which does not include filer.

                  There may be no current docs to filer, but the package exists, as I have installed it on stable and dev versions without problems.

                  But just add your complete filepath (File), a description, the default permission (0644 should be fine), and the content of the file. I'd set the execute mode to "do not run" to be on the safe side but it shouldn't do anything if you don't enter a script/command above it.

                  If a file is configured that way in Filer it gets created and reinstated after a config.xml restore just fine.

                  Don't forget to upvote ๐Ÿ‘ those who kindly offered their time and brainpower to help you!

                  If you're interested, I'm available to discuss details of German-speaking paid support (for companies) if needed.

                  1 Reply Last reply Reply Quote 0
                  • robert321R
                    robert321
                    last edited by

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