OPNsense Forum

English Forums => General Discussion => Topic started by: potes on January 11, 2021, 05:25:08 pm

Title: Migrate to a new machine. How to get old configuration
Post by: potes on January 11, 2021, 05:25:08 pm
Hi,

I'm planning to change my Opnsense home machine. I have been looking to how to backup and restore the configurations files, but the problem I found is how I can reach the backup file.
In my actual Opnsense configuration I have a quad network card (VLAN configuration) that I want to put in my new machine so I cannot use both machines at the same time, so If I disconnect the old machine and I connect the new one I cannot access my nextcloud server (where is the backup).

Is there anyway to have the backup file on the pendrive where I have the installation image to upload via command line from the installation menu? Or is there any way to upload the backup to a new installation where the only machine at the network is the opnsense machine?

I know it probably wont work, but If I take out the hard drive of the old machine (HP Thin Client T610 plus), and put it on the new machine (HP Thin Client T620 Plus), will work?

Thanks in advance.
Title: Re: Migrate to a new machine. How to get old configuration
Post by: bartjsmit on January 11, 2021, 06:28:59 pm
The way I have done this in the past is to build a vanilla OPNsense on the new server and then restore the config. Expect to spend some time with the network interface assignments.

Bart...
Title: Re: Migrate to a new machine. How to get old configuration
Post by: bewue on January 15, 2021, 10:05:44 am
@bartjsmit

That's also how I plan to do it.

How to solve it if the new machine has a different interface constellation? The VLANs on an interface of the old machine should then be placed on a specific interface of the new machine.

Do I have to make manual changes in the configuration file before importing?
Title: Re: Migrate to a new machine. How to get old configuration
Post by: meazz1 on January 15, 2021, 02:43:38 pm

The way i did it was
1. note interface names on both
2. backup configs from both
3. search and update interface names on the new config one from the old one
   (do not go the find all and replace all method, find each line and change that way you're not replacing something
    that don't need to be changed)
4. restore the updated config in the new router

It worked for me but there may be a better way.
Title: Re: Migrate to a new machine. How to get old configuration
Post by: potes on January 21, 2021, 08:49:43 am
Hi,

after searching I found the install function "opnsense-importer", so for what I understand if I put the configuration in a file named "config.xml" on ''/config'' folder it should configure the new machine with the same configuration, am I right? Should I rename the interface names or it should do the change automatically? in case the names differ

Thanks
Title: Re: Migrate to a new machine. How to get old configuration
Post by: tong2x on January 21, 2021, 01:20:30 pm
currently I think there is no direct way to "import" configs
if the interface do not match
maybe they will work it out in the future
Title: Re: Migrate to a new machine. How to get old configuration
Post by: potes on January 29, 2021, 07:40:06 pm
THANK YOU very much, I did it as you told me, I only change the interface of the onboard NIC from bge0 to re0 (te other ones keep there name) and it went seamless.

Hi,

after searching I found the install function "opnsense-importer", so for what I understand if I put the configuration in a file named "config.xml" on ''/config'' folder it should configure the new machine with the same configuration, am I right? Should I rename the interface names or it should do the change automatically? in case the names differ

Thanks