Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
24.1 Legacy Series
»
Backup/Restore config.xml file using command line
« previous
next »
Print
Pages: [
1
]
Author
Topic: Backup/Restore config.xml file using command line (Read 5348 times)
DanMauser
Newbie
Posts: 5
Karma: 0
Backup/Restore config.xml file using command line
«
on:
March 21, 2024, 05:15:28 am »
Is there any way that I can backup/restore OPNSense configuration file (config.xlm) using via CLI/shell command?
Logged
patient0
Newbie
Posts: 30
Karma: 0
Re: Backup/Restore config.xml file using command line
«
Reply #1 on:
March 21, 2024, 08:30:42 am »
I think in the
Installation Instructions
the paragraph "For New installations/migrations follow this process:" covers it.
Logged
jp0469
Jr. Member
Posts: 60
Karma: 8
Re: Backup/Restore config.xml file using command line
«
Reply #2 on:
March 21, 2024, 01:12:30 pm »
You can copy the latest configuration from /conf/config.xml or locate a prior one in /conf/backups if available.
To restore a config, select option 13 from the CLI menu as root.
Logged
Vilhonator
Full Member
Posts: 245
Karma: 13
Re: Backup/Restore config.xml file using command line
«
Reply #3 on:
March 21, 2024, 03:32:31 pm »
There is a way, you can use scp or tftp, but neither give you option to encrypt the file, and you have to be 10000000% sure which config.xml is correct one, since restoring to old configuration is just plain copy text from old config.xml file, paste it to config.xml you want to replace and reboot your opnsense.
Anyway, opnsense by default automatically backs up old configuration whenever you make changes to local cahce and you can restore to one of those from console selecting option 13) Restore a backup.
Logged
franco
Administrator
Hero Member
Posts: 17749
Karma: 1620
Re: Backup/Restore config.xml file using command line
«
Reply #4 on:
March 21, 2024, 04:05:11 pm »
> but neither give you option to encrypt the file
# man opnsense-crypt
Logged
DanMauser
Newbie
Posts: 5
Karma: 0
Re: Backup/Restore config.xml file using command line
«
Reply #5 on:
March 21, 2024, 06:38:40 pm »
> To restore a config, select option 13 from the CLI menu as root
Is there any other option to restore using a command line directly from the shell?
I need to issue a restore from a shell script; That's reason I can't use option 13.
Otherwise, I will incorporate that into the bootstrap method. Thanks all for the answers.
Logged
cookiemonster
Hero Member
Posts: 1830
Karma: 95
Re: Backup/Restore config.xml file using command line
«
Reply #6 on:
March 21, 2024, 11:36:38 pm »
Quote from: franco on March 21, 2024, 04:05:11 pm
> but neither give you option to encrypt the file
# man opnsense-crypt
This one is news to me. Thanks! i have been tryng with base64 a few days ago and put it in the to-do list for afters.
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
24.1 Legacy Series
»
Backup/Restore config.xml file using command line