Problem editing Backup xml files in Notepad++
-
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.
-
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
-
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
-
Same here, used Notepad++ a lot of times to edit the config.xml for different pfSense Installations and never had any issue.
-Rico
-
I'm using notepad++ for manual config edits too, no issues to date.
-
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
-
?
i have windows (CR+LF) not Unix (LF) -
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
-
eh right
-
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
-
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
-
no, the name can be random, i've renamed my backup several times. it check the content and section inside the file
-
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
-
yes of course,
but when you want to restore that section you need to select the same section on the drop down menu