How to migrate config files to a clean install?

I’m planning a clean install of Fedora 34.
The PC is for my own home use and is currently running Fedora 30.
For some applications, I would prefer to keep my customized configurations.
Questions:

  1. Is it really a clean install if I use an old config file?
  2. Should I copy an old config file into the new system before or after installing its application?
  3. What happens if the new version of an application uses a new config-file format?
  4. How do I locate an application’s config files on Fedora?
    I have looked around and googled. My impression is that it would be easier to manually reconfigure Gnome with the gnome-tweak-tool than to locate all the Gnome config files.
4 Likes

There are two sets of configuration files. The first are the system wide configuration files. These are stored in /etc/. For an installed package, you can find the configuration files by using something like this:

rpm -qc <name of package>

When packages are upgraded, if configuration files change, packages do not overwrite existing configuration files. They add new files with the .rpmnew suffix. You can then go over all such files and see what you want to do using the rpmconf tool:

sudo rpmconf -a

If you want to keep these files, you’ll need to manually copy them over. Folks that use multiple machines manage them using ansible and other tools which allows you to set up and manage multiple systems with configuration files. It’s a bit overkill for single machine end-users.

Next, we have user-specific configurations that software store in your home directory. A lot of these will be hidden dot files in $HOME. You can see them using :

ls -lash ~

There are different ways/tools for managing these dot files. See rcm for example:

Fedora package:

https://src.fedoraproject.org/rpms/rcm

Search “manage dotfiles” using your preferred search engine for more information/tools.

These files can also change in format, but a well written tool will ensure backwards compatibility for a few releases to allow users to update. If you’re making a large jump though, this may not work. You can copy these over as you wish and in most cases they’ll work fine. I’d recommend only copying over ones you need rather than the whole set though—that way you get the new bits but with your few customisations.

With that context, here are answers to your questions:

  • Not technically a new install, since you’re not starting with all the default configurations (which may have changed over new versions of software)
  • It shouldn’t matter. If you copy the file over before (and correctly), the application should use it from its first run. If you run the application once, it may create default configuration files that you will then need to overwrite. The latter is better because you get some information on what the default files are and if they’ve changed etc.
  • Some applications migrate old formats to new ones if they detect the old format. Not all applications do this, though. If an application doesn’t, you need to migrate your configuration file to the new format manually.
  • This isn’t Fedora specific—applications decide where they configurations go, and Fedora package maintainers don’t change this. So, the best place to find this information is in the particular application’s documentation. Generally, it’ll be a dotfile in $HOME, and nowadays lots of applications are also using ~/.config which is the suggested location according to the XDG standard. For most command line tools, their manuals should include this information. Try man rcm or man byobu or man tmux for example.

A lot of us keep a separate /home/ partition. We tend to upgrade at each release, but even if we do fresh installs from time to time, we can just mount the /home partition during installation and resume using it. This means that we get the new versions of software and new system wide configuration files but our old user specific configuration files, and then we need to process any new configuration files etc. It’s most useful for us folks that experiment with their system quite a bit and reinstall the same Fedora version frequently.

5 Likes