Solved Moving/merging configuration files?

Greetings all,

is there a way to move/merge configuration files from one machine to a new installation on another machine - both installations using the same version of FreeBSD (11)?

Kindest regards,

Basically all the systems configuration files reside in /etc and /usr/local/etc respectively so you can easily archive those and copy them over. Just be careful with things which might not fully match.

However, as far as I know there's no automated way to handle all this.
Hi ShelLuser,

I was wondering if there is a way to use mergemaster(8) on the /etc and /usr/local/etc only, but as I am understanding the man page, this does not seem to be the case.

Kindest regards,

Well, mergemaster(8) is only used to merge base system configuration files during upgrades, and /etc is the only directory where mergemaster actually does anything.

If you're using the same release on both systems, and actually intend for them to have identical configurations, then just copy everything over. You might use tar(1) to keep things simple.

If you intended to use only a few options from each configuration file, you'll have to edit them by hand. Even if mergemaster could merge files between machines it wouldn't really make the process any faster or easier, since it will first look for every instance where configuration files differ; then show you a complete diff of the files; then ask whether you want to keep the current version, replace it with the new version, or merge the files; then go through the differences line-by-line if you choose to merge them.

EDIT: Now that I think about it, there is a way you could use mergemaster between systems, though it might not be worth the bother. You could mount the root directory of the target system somewhere on the origin system, either directly or using NFS. You could then run mergemaster with the -D /path/to/target flag. It would be the same process you would use to upgrade a jail, only you'd be doing it to a bare-metal system.

I agree that for the present case, identical versions and identical configurations, the direct copy is the obvious answer. However, I was thinking about using this as a test case for a future, e.g., different versions and/or different configurations, where the mergemaster(8) might help me see the differences.

Thank you for the hint.

Kindest regards,

I suggest you look into Ansible and/or Puppet for configuration management.
Hi SirDice,

thank you for the suggestions. I have briefly looked at the web-sites descriptions, but it was over my head. Is there a more detailed description regarding the capabilities and set up regarding my goal?

Hi wblock,

thank you for the suggestions. They both seem more manageable for a simpleton like I.

Kindest regards,