From 1ffcb972dac18ac8a02a8ebd07fb920e613f7cb7 Mon Sep 17 00:00:00 2001 From: felmer <felmer> Date: Tue, 28 Feb 2017 08:29:09 +0000 Subject: [PATCH] SSDM-4507: Restore AS and DSS configuration files and making a full copy of the config files from the installer SVN: 37825 --- .../installer/bin/common-functions.sh | 18 +++++++++ .../bin/restore-config-from-backup.sh | 39 ++++++++----------- 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/installation/resource/installer/bin/common-functions.sh b/installation/resource/installer/bin/common-functions.sh index a4bb0f9be60..3ab92be0f24 100644 --- a/installation/resource/installer/bin/common-functions.sh +++ b/installation/resource/installer/bin/common-functions.sh @@ -301,6 +301,24 @@ executeScriptHooks() done } +# +# Restore configuration file +# +restore() +{ + local source_file=$1 + local destination=$2 + local file=$3 + if [ -e "$source_file" ]; then + if [ -e "$destination/$file" ]; then + echo "cp -p $destination/$file $destination/$file.$version" + cp -p "$destination/$file" "$destination/$file.$version" + fi + echo "cp -p $source_file $destination/$file" + cp -p "$source_file" "$destination/$file" + fi +} + # # Copies a file (first parameter) to a destination (second parameter). # Does nothing if file does not exist. Will follow symbolic links. diff --git a/installation/resource/installer/bin/restore-config-from-backup.sh b/installation/resource/installer/bin/restore-config-from-backup.sh index 1218756c271..a693685df55 100755 --- a/installation/resource/installer/bin/restore-config-from-backup.sh +++ b/installation/resource/installer/bin/restore-config-from-backup.sh @@ -30,31 +30,26 @@ echo "Restoring configuration backup from $CONF to $ROOT ..." # -- AS if [ -d $ROOT/openBIS-server ]; then - cp $CONF/service.properties $ROOT/openBIS-server/jetty/etc/ - cp $CONF/log.xml $ROOT/openBIS-server/jetty/etc/ - cp $CONF/openbis.conf $ROOT/openBIS-server/jetty/etc/ - cp $CONF/jetty.properties $ROOT/openBIS-server/jetty/etc/ - - # for 13.04.10 and older - copyIfExists $CONF/../openBIS-server/jetty/webapps/openbis/welcomePageSimple.html $ROOT/openBIS-server/jetty/webapps/openbis/custom/welcomePageSimpleGeneric.html - - # for 13.04.11 and later - copyIfExists $CONF/../openBIS-server/jetty/webapps/openbis/custom/welcomePageSimpleGeneric.html $ROOT/openBIS-server/jetty/webapps/openbis/custom - - # not always present - copyIfExists $CONF/.keystore $ROOT/openBIS-server/jetty/etc/openBIS.keystore - copyIfExists $CONF/passwd $ROOT/openBIS-server/jetty/etc/ - copyIfExists $CONF/web-client.properties $ROOT/openBIS-server/jetty/etc/ - copyIfExists $CONF/capabilities $ROOT/openBIS-server/jetty/etc/ - copyIfExists $CONF/dss-datasource-mapping $ROOT/openBIS-server/jetty/etc/ + version=`cat $ROOT/openBIS-server/jetty/webapps/openbis/WEB-INF/classes/BUILD-openbis.INFO` + restore $CONF/.keystore $ROOT/openBIS-server/jetty/etc openBIS.keystore + restore $CONF/service.properties $ROOT/openBIS-server/jetty/etc service.properties + restore $CONF/log.xml $ROOT/openBIS-server/jetty/etc log.xml + restore $CONF/openbis.conf $ROOT/openBIS-server/jetty/etc openbis.conf + restore $CONF/jetty.properties $ROOT/openBIS-server/jetty/etc jetty.properties + restore $CONF/passwd $ROOT/openBIS-server/jetty/etc passwd + restore $CONF/web-client.properties $ROOT/openBIS-server/jetty/etc web-client.properties + restore $CONF/dss-datasource-mapping $ROOT/openBIS-server/jetty/etc dss-datasource-mapping + restore $CONF/capabilities $ROOT/openBIS-server/jetty/etc capabilities + restore $CONF/../openBIS-server/jetty/webapps/openbis/custom/welcomePageSimpleGeneric.html $ROOT/openBIS-server/jetty/webapps/openbis/custom welcomePageSimpleGeneric.html + copyConfig $CONF/core-plugins "html/etc$" $ROOT/core-plugins copyFolderIfExists $CONF/start.d $ROOT/openBIS-server/jetty/start.d fi # -- DSS -cp $CONF/dss-service.properties $ROOT/datastore_server/etc/service.properties -cp $CONF/dss-log.xml $ROOT/datastore_server/etc/log.xml -cp $CONF/datastore_server.conf $ROOT/datastore_server/etc/ -# not always present -copyIfExists $CONF/.keystore $ROOT/datastore_server/etc/openBIS.keystore +version=`unzip -c $ROOT/servers/datastore_server/lib/datastore_server-*.jar BUILD-datastore_server.INFO|tail -n 1` +restore $CONF/dss-service.properties $ROOT/datastore_server/etc service.properties +restore $CONF/dss-log.xml $ROOT/datastore_server/etc log.xml +restore $CONF/datastore_server.conf $ROOT/datastore_server/etc datastore_server.conf +restore $CONF/.keystore $ROOT/datastore_server/etc openBIS.keystore copyIfExists $CONF/ext-lib $ROOT/datastore_server \ No newline at end of file -- GitLab