Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
21.1 Legacy Series
»
How do I import a config.xml during install?
« previous
next »
Print
Pages: [
1
]
Author
Topic: How do I import a config.xml during install? (Read 18457 times)
IsaacFL
Full Member
Posts: 217
Karma: 8
How do I import a config.xml during install?
«
on:
March 26, 2021, 09:29:46 pm »
I recently did a reinstall (VM to physical hardware) and I wanted to just import my existing config.xml into the new hardware install. I had to move my 4 port network card from the VM Host, so everything had to go down.
I saved my configuration to a USB, \conf\config.xml
During the boot, I used the opnsense-importer utility to pick my config.xml which worked but only into the "Live Environment".
I could not figure out a way to import during the install process? I ended up having to do the vanilla install, getting an old laptop and configuring it with a static 192.168.1.1/24 (I don't use this private network) and using the web interface to restore the configuration.
I routinely did this with pfsense, if I messed up something it was quicker to just reinstall and import the backup in one step. Two minutes vs this stretched into 15 minutes.
It is not obvious from the documentation how to do this?
Logged
packet loss
Full Member
Posts: 134
Karma: 26
Re: How do I import a config.xml during install?
«
Reply #1 on:
March 26, 2021, 11:09:39 pm »
I recall being able to import mine. I think I did a complete install but didn't really configure anything beyond getting past the point of the initial install. Then from the shell I ran the opnsense-importer to import my config.xml from a USB drive and then rebooted.
Logged
IsaacFL
Full Member
Posts: 217
Karma: 8
Re: How do I import a config.xml during install?
«
Reply #2 on:
March 27, 2021, 01:33:22 am »
Looks like the step would be at the console, immediately after install:
Shell
# opnsense-importer
picked my USB from the list.
# Reboot
Wondering if I should have rebooted by exit, then option 6) Reboot System.
This did seem to work. I did not de a full reinstall for this test. I backed up my config to a FAT USB to file \conf\config.xml.
I deleted one of my NTP timer servers.
Went to the console and did the above. After reboot, my NTP server was back, so must have worked.
Option 13) Restore from a backup is not the route to go to get from USB. Shell is.
Logged
packet loss
Full Member
Posts: 134
Karma: 26
Re: How do I import a config.xml during install?
«
Reply #3 on:
March 27, 2021, 02:23:31 pm »
I haven't had the time to test alternative methods. It's also probably been over a year that I've installed OPNsense, and believe there's been quite a few changes to the install process. I'm thinking below should also work:
From console menu
1. install
2. reboot
3. restore
I'm glad you got it to work. Saved me alot of time last time I did it. There's also a recent bug reported regarding importing an encrypted backup
#4861
. Mabye some potential issues maybe resolved during the code audit.
«
Last Edit: March 27, 2021, 02:52:23 pm by packet loss
»
Logged
dcol
Hero Member
Posts: 635
Karma: 51
Re: How do I import a config.xml during install?
«
Reply #4 on:
September 19, 2021, 08:59:22 pm »
I know this is an older topic but for those who are looking for the easiest method to install OPNsense with the same configuation, I did this. Chime in if I am wrong.
1. Backup configuration and place on FAT32 formatted USB drive under folder \conf and rename backup to config.xml.
2. Install OPNsense and when asked for configuration restore, choose the USB with \conf\config.xml
That's it.
Logged
franco
Administrator
Hero Member
Posts: 17707
Karma: 1618
Re: How do I import a config.xml during install?
«
Reply #5 on:
September 20, 2021, 01:53:58 pm »
Right. The \conf directory is actually meant to be used as a copy of an existing installation to restore as much as possible contained within that directory, e.g. SSH keys, DHCP leases and old configuration backups.
Cheers,
Franco
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
21.1 Legacy Series
»
How do I import a config.xml during install?