diff --git a/migration.sh b/migration.sh index ccce2d5..ef552bc 100644 --- a/migration.sh +++ b/migration.sh @@ -79,8 +79,11 @@ change_config(){ # sshpass -p "$DESTINATION_PASSWORD" ssh $DESTINATION_USER@$DESTINATION_IP -p $DESTINATION_PORT "sed -i \"s|\(jdbc:postgresql://localhost:5432/\)[^?]*|\1${DESTINATION_DB_NAME}|g\" $DESTINATION_PLATFORM_PATH/conf/db.conf" #db wo host sshpass -p "$DESTINATION_PASSWORD" ssh $DESTINATION_USER@$DESTINATION_IP -p $DESTINATION_PORT "sed -i \"s|\(jdbc:postgresql://[^:/]*:[0-9]*/\)[^?]*|\1${DESTINATION_DB_NAME}|g\" $DESTINATION_PLATFORM_PATH/conf/db.conf" - sshpass -p "$DESTINATION_PASSWORD" ssh $DESTINATION_USER@$DESTINATION_IP -p $DESTINATION_PORT "sed -i \"s|\(jdbc:postgresql://[^:/]*:[0-9]*/\)[^?]*|\1${INTERNAL_DATABASE_IP}:5432/${DESTINATION_DB_NAME}|g\" $DESTINATION_PLATFORM_PATH/conf/db.conf" - + #sshpass -p "$DESTINATION_PASSWORD" ssh $DESTINATION_USER@$DESTINATION_IP -p $DESTINATION_PORT "sed -i \"s|\(jdbc:postgresql://[^:/]*:[0-9]*/\)[^?]*|\1${INTERNAL_DATABASE_IP}:5432/${DESTINATION_DB_NAME}|g\" $DESTINATION_PLATFORM_PATH/conf/db.conf" + #change host + sshpass -p "$DESTINATION_PASSWORD" ssh $DESTINATION_USER@$DESTINATION_IP -p $DESTINATION_PORT "sed -i \"s|\\(jdbc:postgresql://\\)[^:/]*|\\1${INTERNAL_DATABASE_IP}|g\" $DESTINATION_PLATFORM_PATH/conf/db.conf" + #change database name + sshpass -p "$DESTINATION_PASSWORD" ssh $DESTINATION_USER@$DESTINATION_IP -p $DESTINATION_PORT "sed -i \"s|\\(jdbc:postgresql://[^:/]*:[0-9]*/\\)[^?]*|\\1${DESTINATION_DB_NAME}|g\" $DESTINATION_PLATFORM_PATH/conf/db.conf" } evt_full_rsync(){ @@ -108,15 +111,14 @@ fonts_rsync(){ sshpass -p "$DESTINATION_PASSWORD" rsync -e "ssh -p $DESTINATION_PORT" -avz --ignore-existing $SOURCE_PLATFORM_PATH/bin/storage/1/fonts/ $DESTINATION_USER@$DESTINATION_IP:$DESTINATION_PLATFORM_PATH/bin/storage/1/fonts/ } -if [[ "$EVT_COMMON" == 0 ]]; then - echo "Download only files from evt/common" - evt_common_files_rsync -elif [[ "$EVT_COMMON" == 1 ]]; then - echo "Download full evt" - evt_full_rsync +if [[ "$DOWNLOAD_PLATFORM" == 1 ]]; then + echo "Download platform from source" + download_platform +elif [[ "$EVT_COMMON" == 0 ]]; then + echo "No download platform" fi -download_platform + db_backup send_backup