mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

kenneth_suter
18.59.2007 3aedf18e6cfc7b59513da063663772037bb58b00
This fix addresses issue 1799 in which an upgrade would fail for a server with SSL configured.  The cause of the problem was found to be that files important to SSL configuration (namely the keystore file) were not copied from the old installation to the upgraded installation.  This commit copies files that do not appear in the upgraded config directory from the old config directory. 
1 files modified
38 ■■■■■ changed files
opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java 38 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
@@ -848,9 +848,19 @@
        setCurrentProgressStep(
                UpgradeProgressStep.UPGRADING_COMPONENTS);
        upgradeComponents();
        // The config directory may contain files that are needed
        // by the new installation (e.g. SSL config files and tasks)
        File oldConfigDir =
                new File(getFilesBackupDirectory(),
                         Installation.CONFIG_PATH_RELATIVE);
        File newConfigDir =
                getInstallation().getConfigurationDirectory();
        copyNonexistentFiles(oldConfigDir, newConfigDir);
        notifyListeners(formatter.getFormattedDone() +
                formatter.getLineBreak());
        LOG.log(Level.INFO, "componnet upgrade finished");
        LOG.log(Level.INFO, "component upgrade finished");
      } catch (ApplicationException e) {
        notifyListeners(formatter.getFormattedError() +
                formatter.getLineBreak());
@@ -1364,6 +1374,32 @@
    }
  }
  /**
   * Copies any files appearing in <code>source</code> and not appearing
   * in <code>target</code> from <code>source</code> to
   * <code>target</code>.
   * @param source source directory
   * @param target target directory
   * @throws ApplicationException if there is a problem copying files
   */
  private void copyNonexistentFiles(File source, File target)
          throws ApplicationException
  {
    if (source != null && target != null) {
      String[] oldFileNames = source.list();
      if (oldFileNames != null) {
        FileManager fm = new FileManager();
        for (String oldFileName : oldFileNames) {
          File f = new File(target, oldFileName);
          if (!f.exists()) {
            File oldFile = new File(source, oldFileName);
            fm.copy(oldFile, target);
          }
        }
      }
    }
  }
  private boolean calculateConfigCustomizations() throws ApplicationException {
    boolean isCustom = false;
    try {