Skip to content
Snippets Groups Projects
Commit 679d51b0 authored by kaloyane's avatar kaloyane
Browse files

[LMS-2427] working backup scripts for the generic installation.

SVN: 22466
parent 6d649790
No related branches found
No related tags found
No related merge requests found
...@@ -38,6 +38,3 @@ cp $ROOT/datastore_server/etc/datastore_server.conf $CONF/datastore_server.conf ...@@ -38,6 +38,3 @@ cp $ROOT/datastore_server/etc/datastore_server.conf $CONF/datastore_server.conf
# not always present # not always present
copyIfExists $ROOT/datastore_server/etc/openBIS.keystore $CONF/.keystore copyIfExists $ROOT/datastore_server/etc/openBIS.keystore $CONF/.keystore
copyIfExists $ROOT/datastore_server/ext-lib $CONF copyIfExists $ROOT/datastore_server/ext-lib $CONF
# screening-specific
cp $ROOT/datastore_server/etc/tabular-data-graph.properties $CONF/tabular-data-graph.properties
...@@ -41,8 +41,4 @@ echo "Creating database dumps for $OPENBIS_DB and $IMAGING_DB..." ...@@ -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" 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 $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" echo "DONE"
...@@ -45,6 +45,3 @@ cp $CONF/datastore_server.conf $ROOT/datastore_server/etc/ ...@@ -45,6 +45,3 @@ cp $CONF/datastore_server.conf $ROOT/datastore_server/etc/
# not always present # not always present
copyIfExists $CONF/.keystore $ROOT/datastore_server/etc/openBIS.keystore copyIfExists $CONF/.keystore $ROOT/datastore_server/etc/openBIS.keystore
copyIfExists $CONF/ext-lib $ROOT/datastore_server copyIfExists $CONF/ext-lib $ROOT/datastore_server
# screening-specific
cp $CONF/tabular-data-graph.properties $ROOT/datastore_server/etc/
#!/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
#!/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"
#!/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/
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