diff --git a/installation/resource/installer/bin/backup-config.sh b/installation/resource/installer/bin/backup-config.sh index 2d65840f653c33df8cc830893bedda958950f4be..7871ac491c8b65a2679886f1c81abf52b3b44c47 100755 --- a/installation/resource/installer/bin/backup-config.sh +++ b/installation/resource/installer/bin/backup-config.sh @@ -38,6 +38,3 @@ cp $ROOT/datastore_server/etc/datastore_server.conf $CONF/datastore_server.conf # not always present copyIfExists $ROOT/datastore_server/etc/openBIS.keystore $CONF/.keystore copyIfExists $ROOT/datastore_server/ext-lib $CONF - -# screening-specific -cp $ROOT/datastore_server/etc/tabular-data-graph.properties $CONF/tabular-data-graph.properties diff --git a/installation/resource/installer/bin/backup-installation.sh b/installation/resource/installer/bin/backup-installation.sh index 6aff8db91fd9bbfb21e9d01b07b416972fad16aa..67b3d28ebed1431795f7da4e017f08fdecbc1ad9 100755 --- a/installation/resource/installer/bin/backup-installation.sh +++ b/installation/resource/installer/bin/backup-installation.sh @@ -41,8 +41,4 @@ echo "Creating database dumps for $OPENBIS_DB and $IMAGING_DB..." echo "$PG_DUMP -U $DB_USER_NAME -Fc $OPENBIS_DB > $BACKUP_DIR/$OPENBIS_DB.dmp" $PG_DUMP -U $DB_USER_NAME -Fc $OPENBIS_DB > $BACKUP_DIR/$OPENBIS_DB.dmp -# screening-specific -echo "$PG_DUMP -U $DB_USER_NAME -Fc $IMAGING_DB > $BACKUP_DIR/$IMAGING_DB.dmp" -$PG_DUMP -U $DB_USER_NAME -Fc $IMAGING_DB > $BACKUP_DIR/$IMAGING_DB.dmp - echo "DONE" diff --git a/installation/resource/installer/bin/restore-config-from-backup.sh b/installation/resource/installer/bin/restore-config-from-backup.sh index cf456fb5c4f6206cb63f856ba5c6cc7c9bc38625..c6b2418ee7da5956ac94c685289327ad2f6d6a18 100755 --- a/installation/resource/installer/bin/restore-config-from-backup.sh +++ b/installation/resource/installer/bin/restore-config-from-backup.sh @@ -45,6 +45,3 @@ cp $CONF/datastore_server.conf $ROOT/datastore_server/etc/ # not always present copyIfExists $CONF/.keystore $ROOT/datastore_server/etc/openBIS.keystore copyIfExists $CONF/ext-lib $ROOT/datastore_server - -# screening-specific -cp $CONF/tabular-data-graph.properties $ROOT/datastore_server/etc/ diff --git a/screening/dist/tarball/installer/bin/backup-config.sh b/screening/dist/tarball/installer/bin/backup-config.sh new file mode 100755 index 0000000000000000000000000000000000000000..2d65840f653c33df8cc830893bedda958950f4be --- /dev/null +++ b/screening/dist/tarball/installer/bin/backup-config.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# makes a backup of all configuration files to the specified directory + +CONF=$1 +if [ "$CONF" == "" ]; then + echo Error: directory where configuration should be backed up has not been specified! + exit 1 +fi +mkdir -p $CONF + +BASE=`dirname "$0"` +if [ ${BASE#/} == ${BASE} ]; then + BASE="`pwd`/${BASE}" +fi + +source $BASE/common-functions.sh +ROOT=$BASE/../servers + +# -- GLOBAL +cp $BASE/env $CONF/ + +# -- AS +cp $ROOT/openBIS-server/jetty/webapps/openbis/WEB-INF/classes/service.properties $CONF/ +cp $ROOT/openBIS-server/jetty/etc/log.xml $CONF/ +cp $ROOT/openBIS-server/jetty/bin/openbis.conf $CONF/ +cp $ROOT/openBIS-server/jetty/etc/jetty.xml $CONF/ +cp $ROOT/openBIS-server/jetty/bin/jetty.properties $CONF/ +cp $ROOT/openBIS-server/jetty/webapps/openbis/welcomePageSimple.html $CONF/ +# not always present +copyIfExists $ROOT/openBIS-server/jetty/etc/openBIS.keystore $CONF/.keystore +copyIfExists $ROOT/openBIS-server/jetty/etc/passwd $CONF/ +copyIfExists $ROOT/openBIS-server/jetty/etc/web-client.properties $CONF/ + +# -- DSS +cp $ROOT/datastore_server/etc/service.properties $CONF/dss-service.properties +cp $ROOT/datastore_server/etc/log.xml $CONF/dss-log.xml +cp $ROOT/datastore_server/etc/datastore_server.conf $CONF/datastore_server.conf +# not always present +copyIfExists $ROOT/datastore_server/etc/openBIS.keystore $CONF/.keystore +copyIfExists $ROOT/datastore_server/ext-lib $CONF + +# screening-specific +cp $ROOT/datastore_server/etc/tabular-data-graph.properties $CONF/tabular-data-graph.properties diff --git a/screening/dist/tarball/installer/bin/backup-installation.sh b/screening/dist/tarball/installer/bin/backup-installation.sh new file mode 100755 index 0000000000000000000000000000000000000000..6aff8db91fd9bbfb21e9d01b07b416972fad16aa --- /dev/null +++ b/screening/dist/tarball/installer/bin/backup-installation.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Moves the current installation to a backup folder. +BASE=`dirname "$0"` +if [ ${BASE#/} == ${BASE} ]; then + BASE="`pwd`/${BASE}" +fi + +BACKUP_DIR=$1 +if [ "$BACKUP_DIR" == "" ]; then + echo ERROR: directory in which configuration should be stored has not been specified! + exit 1 +fi + +source $BASE/env + +$BASE/alldown.sh + +ROOT_DIR=$BASE/../servers +CONFIG=$BACKUP_DIR/config-backup + +echo "Creating backup folder $BACKUP_DIR ..." +mkdir -p $CONFIG +$BASE/backup-config.sh $CONFIG + +OLD_BIS=$BACKUP_DIR/openBIS-server + +echo "Copying old installation to backup dir" + +echo "mv $ROOT_DIR/openBIS-server $OLD_BIS" +mv $ROOT_DIR/openBIS-server $OLD_BIS + +echo "mv $ROOT_DIR/datastore_server $BACKUP_DIR/datastore_server" +mv $ROOT_DIR/datastore_server $BACKUP_DIR/datastore_server + + + +# Note: to restore the database afterwards one can use: +# pg_restore -d db-name db-file.dmp +echo "Creating database dumps for $OPENBIS_DB and $IMAGING_DB..." + +echo "$PG_DUMP -U $DB_USER_NAME -Fc $OPENBIS_DB > $BACKUP_DIR/$OPENBIS_DB.dmp" +$PG_DUMP -U $DB_USER_NAME -Fc $OPENBIS_DB > $BACKUP_DIR/$OPENBIS_DB.dmp + +# screening-specific +echo "$PG_DUMP -U $DB_USER_NAME -Fc $IMAGING_DB > $BACKUP_DIR/$IMAGING_DB.dmp" +$PG_DUMP -U $DB_USER_NAME -Fc $IMAGING_DB > $BACKUP_DIR/$IMAGING_DB.dmp + +echo "DONE" diff --git a/screening/dist/tarball/installer/bin/restore-config-from-backup.sh b/screening/dist/tarball/installer/bin/restore-config-from-backup.sh new file mode 100755 index 0000000000000000000000000000000000000000..cf456fb5c4f6206cb63f856ba5c6cc7c9bc38625 --- /dev/null +++ b/screening/dist/tarball/installer/bin/restore-config-from-backup.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Overrides all configuration files with those which can be found in the specified config backup directory. +# Assumes that openbis is installed in the parent directory of the directory where this script is located. + +CONF=$1 +if [ "$CONF" == "" ]; then + echo Error: directory from which configuration should be restored has not been specified! + exit 1 +fi + +BASE=`dirname "$0"` +if [ ${BASE#/} == ${BASE} ]; then + BASE="`pwd`/${BASE}" +fi + +source $BASE/common-functions.sh +ROOT=$BASE/../servers + +echo "Restoring configuration backup from $CONF to $ROOT ..." + +# -- GLOBAL +if [ -e "$CONF/env" ]; then + source $CONF/env + if [ -n "$RESTORE_ENV_FROM_BACKUP" ]; then + cp $CONF/env $BASE/ + fi +fi + +# -- AS +cp $CONF/service.properties $ROOT/openBIS-server/jetty/webapps/openbis/WEB-INF/classes/ +cp $CONF/log.xml $ROOT/openBIS-server/jetty/etc/ +cp $CONF/openbis.conf $ROOT/openBIS-server/jetty/bin/ +cp $CONF/jetty.xml $ROOT/openBIS-server/jetty/etc/ +cp $CONF/jetty.properties $ROOT/openBIS-server/jetty/bin/ +cp $CONF/welcomePageSimple.html $ROOT/openBIS-server/jetty/webapps/openbis/ +# 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/ + +# -- 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 +copyIfExists $CONF/ext-lib $ROOT/datastore_server + +# screening-specific +cp $CONF/tabular-data-graph.properties $ROOT/datastore_server/etc/