Instead of having a single server.cfg file that is a mix of installation-time defaults and manual overrides, a practice I've seen really help with config management is to split the 2 purposes into distinct files.
server-defaults.cfg
This file is overwritten at every upgrade/installation. It is not designed to be modified locally and acts as the default value list and as a template/documentation file for server operators to base their customizations upon.
server-overrides.cfg
This file is initially blank. Any value declared here will override the value in -defaults. To return a server to vanilla, simply clear out this file. To share a custom server configuration, share this file.
Another benefit here is that sharing -overrides is relatively forwards/backwards compatible and you don't need to worry about merging any changes with the vanilla config file.
server-defaults.cfg
This file is overwritten at every upgrade/installation. It is not designed to be modified locally and acts as the default value list and as a template/documentation file for server operators to base their customizations upon.
server-overrides.cfg
This file is initially blank. Any value declared here will override the value in -defaults. To return a server to vanilla, simply clear out this file. To share a custom server configuration, share this file.
Another benefit here is that sharing -overrides is relatively forwards/backwards compatible and you don't need to worry about merging any changes with the vanilla config file.