Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-1067

Add ability to auto-merge old configs with new configs during 'ant update'



    • Type: New Feature
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Won't Fix
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Attachments:
    • Comments:
    • Documentation Status:


      This was an idea that came out of discussion of DS-1060 (now closed)

      Essentially, the idea is to provide an optional way to try to "auto-merge" your old configurations into the newly updated config files whenever you run 'ant update' command.

      I created an early version of this idea (see attached 'ant-update-config-merge.patch'), but it's not perfect. Ant is a bit limited in what it can do in terms of configuration files. (NOTE: Currently this patch changes the behavior of '-Dconfig=[path-to-config]' option such that it attempts to merge configuration file(s) at the specified ${dspace.dir}/config/* directories with the default new configuration file(s). In the future, we may want to change this patch so that this merging behavior is optional, e.g. perhaps you would need to specify a "-DmergeConfigs=true" flag or similar)

      This patch adds the following features:

      • If you run 'ant -Dconfig=[path-to-config] update' option, a new Ant 'target' called 'retain_main_config_settings' will attempt to retain/migrate most of your old Configuration settings (in all your *.properties & *.cfg files, including dspace.cfg) to the new version of the same configuration file. (WARNING: There are some exceptions – see below for more)

      There are some exceptions to what configs can be migrated/retained easily (based on limitations of Ant). Currently, I have NOT been able to figure out how to retain the following settings:

      • Settings which are commented out by default in new version of config file
      • Settings which do not (or no longer) exist in the new version of config file
      • Settings which are multi-line (full value takes up multiple lines, e.g. most plugin/crosswalk settings)
      • Settings which are not in valid Properties-file format (no XML-based settings can be retained at this time)

      So, the end result, is that many (but not all) configuration settings can be auto-merged during the 'ant update' process. So, whether you've made customizations to your dspace.cfg, log4j.properties, anything in /config/modules/*, etc. those customized settings will be auto-merged into the new version of the configuration file (and your old copy of the configuration file will be moved to a *.old file). Again, this merging is not 100% perfect (which is why the old configuration is always first copied to a *.old file), but it is able to retain many of your configurations for you in an automated fashion.




            Unassigned Unassigned
            tdonohue Tim Donohue
            0 Vote for this issue
            1 Start watching this issue