Restore backup file from the console CLI
-
Hello,
Is there a way to replace the config by uploading the backup XML file via the console CLI?
-
@Wolfgangthegreat Yes you can edit the file:
https://docs.netgate.com/pfsense/en/latest/config/xml-configuration-file.html#edit-in-place
-
@SteveITS Thank you
- But this looks like editing from the GUI, or is it access from the console "shell" menu command?
- Is there an editor at the console that is nicer than vi, like nano?
- Is enabling a rule in the config is by removing the <disabled></disabled> in the rule?
-
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-configurationIf 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 -
@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?"
-
@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.
-
@patient0 Thanks!