Skip to content
Snippets Groups Projects
Commit 1ffcb972 authored by felmer's avatar felmer
Browse files

SSDM-4507: Restore AS and DSS configuration files and making a full copy of...

SSDM-4507: Restore AS and DSS configuration files and making a full copy of the config files from the installer

SVN: 37825
parent 08895b83
No related branches found
No related tags found
No related merge requests found
...@@ -301,6 +301,24 @@ executeScriptHooks() ...@@ -301,6 +301,24 @@ executeScriptHooks()
done 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). # Copies a file (first parameter) to a destination (second parameter).
# Does nothing if file does not exist. Will follow symbolic links. # Does nothing if file does not exist. Will follow symbolic links.
......
...@@ -30,31 +30,26 @@ echo "Restoring configuration backup from $CONF to $ROOT ..." ...@@ -30,31 +30,26 @@ echo "Restoring configuration backup from $CONF to $ROOT ..."
# -- AS # -- AS
if [ -d $ROOT/openBIS-server ]; then if [ -d $ROOT/openBIS-server ]; then
cp $CONF/service.properties $ROOT/openBIS-server/jetty/etc/ version=`cat $ROOT/openBIS-server/jetty/webapps/openbis/WEB-INF/classes/BUILD-openbis.INFO`
cp $CONF/log.xml $ROOT/openBIS-server/jetty/etc/ restore $CONF/.keystore $ROOT/openBIS-server/jetty/etc openBIS.keystore
cp $CONF/openbis.conf $ROOT/openBIS-server/jetty/etc/ restore $CONF/service.properties $ROOT/openBIS-server/jetty/etc service.properties
cp $CONF/jetty.properties $ROOT/openBIS-server/jetty/etc/ restore $CONF/log.xml $ROOT/openBIS-server/jetty/etc log.xml
restore $CONF/openbis.conf $ROOT/openBIS-server/jetty/etc openbis.conf
# for 13.04.10 and older restore $CONF/jetty.properties $ROOT/openBIS-server/jetty/etc jetty.properties
copyIfExists $CONF/../openBIS-server/jetty/webapps/openbis/welcomePageSimple.html $ROOT/openBIS-server/jetty/webapps/openbis/custom/welcomePageSimpleGeneric.html restore $CONF/passwd $ROOT/openBIS-server/jetty/etc passwd
restore $CONF/web-client.properties $ROOT/openBIS-server/jetty/etc web-client.properties
# for 13.04.11 and later restore $CONF/dss-datasource-mapping $ROOT/openBIS-server/jetty/etc dss-datasource-mapping
copyIfExists $CONF/../openBIS-server/jetty/webapps/openbis/custom/welcomePageSimpleGeneric.html $ROOT/openBIS-server/jetty/webapps/openbis/custom 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
# 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/
copyConfig $CONF/core-plugins "html/etc$" $ROOT/core-plugins copyConfig $CONF/core-plugins "html/etc$" $ROOT/core-plugins
copyFolderIfExists $CONF/start.d $ROOT/openBIS-server/jetty/start.d copyFolderIfExists $CONF/start.d $ROOT/openBIS-server/jetty/start.d
fi fi
# -- DSS # -- DSS
cp $CONF/dss-service.properties $ROOT/datastore_server/etc/service.properties version=`unzip -c $ROOT/servers/datastore_server/lib/datastore_server-*.jar BUILD-datastore_server.INFO|tail -n 1`
cp $CONF/dss-log.xml $ROOT/datastore_server/etc/log.xml restore $CONF/dss-service.properties $ROOT/datastore_server/etc service.properties
cp $CONF/datastore_server.conf $ROOT/datastore_server/etc/ restore $CONF/dss-log.xml $ROOT/datastore_server/etc log.xml
# not always present restore $CONF/datastore_server.conf $ROOT/datastore_server/etc datastore_server.conf
copyIfExists $CONF/.keystore $ROOT/datastore_server/etc/openBIS.keystore restore $CONF/.keystore $ROOT/datastore_server/etc openBIS.keystore
copyIfExists $CONF/ext-lib $ROOT/datastore_server copyIfExists $CONF/ext-lib $ROOT/datastore_server
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment