Another possibility to help during configuration files upgrades would be to use Config::Model.
To provide configuration files upgrade, this tool needs:
- a description of the structure and properties of the conf file (constraints and default values)
- a writer and a parser so conf file data is loaded in Config::Model (which know how to use them thanks to the description above)
Debian default configuration can be specified in the description above.
When upgrading, Config::Model will:
- load old users data (no matter how extensive the modifications are)
- discard obsolete config parameters
- provide default values for new parameters
The only drawback (currently) is that comments are lost.
As a bonus, the user will get graphical or curses interfaces to further customize configuration data.
If you want to play with this upgrade feature, you can try it with /etc/ssh/sshd_config upgrade. (See Config::Model::OpenSsh)
Feel free to contact Config::Model author if you need more explanations on upgrade possibilities with Config::Model