From ce2fc1a31e783b5c7b143c4ed5c8755edf577882 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Mon, 18 Jun 2007 19:59:43 +0000
Subject: [PATCH] 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.
---
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java | 38 +++++++++++++++++++++++++++++++++++++-
1 files changed, 37 insertions(+), 1 deletions(-)
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
index 8c29046..eb6d770 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
+++ b/opendj-sdk/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 {
--
Gitblit v1.10.0