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

Problem editing Backup xml files in Notepad++

Scheduled Pinned Locked Moved General pfSense Questions
14 Posts 4 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.
  • P
    Phizix
    last edited by Phizix Mar 31, 2020, 5:10 PM Mar 31, 2020, 5:07 PM

    All,

    I am experiencing some frustration attempting to update my static mappings.
    I saved a DHCP section backup. I verified I can restore the file saved successfully. I built my list in a copy of the file in Notepad++ and saved it. When I tried to restore it to my SG-3100 it gives me this message - "An area to restore was selected but the correct xml tag could not be located."

    So I tried an experiment. I made another copy of the good file, opened it in Notepad++, inserted a space and removed it (so I could trigger a save). When I save and attempt to restore the saved file, it gives me the same error.

    I have XML tools plugin installed and I have verified that the EOL conversion is set to UNIX(LF).

    Can anyone give me clue as to what is happening. I was under the impression that Notepad++ handles xml files correctly.

    Any help would be much appreciated.

    Phizix

    P.S. Yes, I am asking it to only import the DHCP server settings.

    1 Reply Last reply Reply Quote 0
    • P
      Phizix
      last edited by Phizix Apr 1, 2020, 5:36 PM Apr 1, 2020, 5:33 PM

      All,

      I ended up using an xml editor mentioned by someone on the forums in another post. [ XML Copy Editor ]

      It seems to work fine. It loaded my edits, but then wouldn't start the DHCP server - DOH!

      It wasn't too bad, turned out to be a reservation for 192.168.0.116 lost a "." and was entered as 192.168.0116 which is of course incorrect. Easy to fix.

      If anyone knows what settings to use in Notepad++ to make it work correctly, I would prefer that since I use it for work and I am very familiar with the interface.

      Phizix

      1 Reply Last reply Reply Quote 0
      • K
        kiokoman LAYER 8
        last edited by Apr 1, 2020, 5:45 PM

        i'm using notepad++ almost every day to tamper / destroy and revive my pfsense vm to test stuff 😂 , i didn't do anything special, just installed it without any special settings under windows 10

        ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
        Please do not use chat/PM to ask for help
        we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
        Don't forget to Upvote with the 👍 button for any post you find to be helpful.

        1 Reply Last reply Reply Quote 0
        • R
          Rico LAYER 8 Rebel Alliance
          last edited by Apr 1, 2020, 5:52 PM

          Same here, used Notepad++ a lot of times to edit the config.xml for different pfSense Installations and never had any issue.

          -Rico

          1 Reply Last reply Reply Quote 0
          • A
            awebster
            last edited by Apr 1, 2020, 6:13 PM

            I'm using notepad++ for manual config edits too, no issues to date.

            –A.

            1 Reply Last reply Reply Quote 0
            • P
              Phizix
              last edited by Phizix Apr 1, 2020, 8:49 PM Apr 1, 2020, 8:48 PM

              @Rico & @awebster

              What is your environment (i.e. OS, etc.)?

              I don't understand the result since I took a copy that imports fine, loaded it in Notepad++ and forced a save with exactly the same information, then it could not be read by the restore in pfsense.

              It must be either something in my Notepad++ config or difference of OS environment.

              Completely puzzled.

              Phizix

              1 Reply Last reply Reply Quote 0
              • K
                kiokoman LAYER 8
                last edited by kiokoman Apr 1, 2020, 8:53 PM Apr 1, 2020, 8:52 PM

                Immagine.jpg

                ?
                i have windows (CR+LF) not Unix (LF)

                ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
                Please do not use chat/PM to ask for help
                we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
                Don't forget to Upvote with the 👍 button for any post you find to be helpful.

                1 Reply Last reply Reply Quote 0
                • P
                  Phizix
                  last edited by Apr 1, 2020, 9:22 PM

                  @kiokoman

                  If you backup a config area (say DHCP) and then open it, what does it show under the menu item "Edit\EOL Conversion". Whichever item is grayed out (greyed if you are British) is the active one. My default is also "Windows (CR+LF)" with "UTF-8", but the backup is not a new document.

                  It should preserve whatever format it opens. Mine opens and shows it as "UNIX (LF)" when I open the xml files from a pfsense backup.

                  What I have not tried is the same experiment with a complete backup of all areas. That file has "<?xml version="1.0"?>" as the very first line.

                  I tried adding that the the DHCP file, but no joy.

                  Phizix

                  1 Reply Last reply Reply Quote 0
                  • K
                    kiokoman LAYER 8
                    last edited by Apr 1, 2020, 9:30 PM

                    eh right
                    Immagine.jpg

                    ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
                    Please do not use chat/PM to ask for help
                    we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
                    Don't forget to Upvote with the 👍 button for any post you find to be helpful.

                    1 Reply Last reply Reply Quote 0
                    • P
                      Phizix
                      last edited by Phizix Apr 2, 2020, 5:05 PM Apr 2, 2020, 5:02 PM

                      All,

                      So I tried a different experiment last night. I was adding a bunch of aliases and saved the entire config, and edited the file in Notepad++ to add more aliases.

                      Then I tried restoring the edited file and it works fine. -- GO FIGURE?!

                      @kiokoman - Thanks for the response. I notice at the bottom status bar (third item from the far right) that it shows the file as "Unix (LF)". Thanks for the screenie.

                      Best regards,

                      Phizix

                      1 Reply Last reply Reply Quote 0
                      • P
                        Phizix
                        last edited by Phizix Apr 2, 2020, 5:05 PM Apr 2, 2020, 5:04 PM

                        Netgate Team (or anyone else that knows),

                        One last thought/question. Does the restore look at the file name in any way?

                        I did not leave the "dhcp-" part at the beginning of the file name when restoring the DHCP server info.

                        Thanks again,

                        Phizix

                        1 Reply Last reply Reply Quote 0
                        • K
                          kiokoman LAYER 8
                          last edited by Apr 2, 2020, 5:07 PM

                          no, the name can be random, i've renamed my backup several times. it check the content and section inside the file

                          ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
                          Please do not use chat/PM to ask for help
                          we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
                          Don't forget to Upvote with the 👍 button for any post you find to be helpful.

                          1 Reply Last reply Reply Quote 0
                          • P
                            Phizix
                            last edited by Apr 2, 2020, 5:26 PM

                            @kiokoman

                            Just to be clear, have you saved just a section (not the whole config) edited it in Notepad++ and then restored just that section from the edited file of just that section?

                            Thanks again,

                            Phizix

                            1 Reply Last reply Reply Quote 0
                            • K
                              kiokoman LAYER 8
                              last edited by Apr 2, 2020, 10:12 PM

                              yes of course,
                              but when you want to restore that section you need to select the same section on the drop down menu

                              ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
                              Please do not use chat/PM to ask for help
                              we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
                              Don't forget to Upvote with the 👍 button for any post you find to be helpful.

                              1 Reply Last reply Reply Quote 0
                              5 out of 14
                              • First post
                                5/14
                                Last post
                              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                This community forum collects and processes your personal information.
                                consent.not_received