diff --git a/migration.sh b/migration.sh index d3bde93..bb58fcf 100644 --- a/migration.sh +++ b/migration.sh @@ -42,11 +42,13 @@ send_backup() { fi } create_and_restore_db() { - sed -e "s/DESTINATION_DB_NAME/${DESTINATION_DB_NAME}/" \ - -e "s/DESTINATION_POSTGRES_PASSWORD/${DESTINATION_POSTGRES_PASSWORD}/"\ - -e "s/DB_BACKUP/${DB_BACKUP}/"\ - create_db.sh.template > create_db.sh - sshpass -p "$DESTINATION_DATABASE_PASSWORD" ssh -p $DESTINATION_DATABASE_PORT $DESTINATION_DATABASE_USER@$DESTINATION_DATABASE_IP 'bash -s' < create_db.sh + if [[ "$EVENT_STORE" == 0 ]] || [[ "$EVENT_STORE" == 1 ]]; then + sed -e "s/DESTINATION_DB_NAME/${DESTINATION_DB_NAME}/" \ + -e "s/DESTINATION_POSTGRES_PASSWORD/${DESTINATION_POSTGRES_PASSWORD}/"\ + -e "s/DB_BACKUP/${DB_BACKUP}/"\ + create_db.sh.template > create_db.sh + sshpass -p "$DESTINATION_DATABASE_PASSWORD" ssh -p $DESTINATION_DATABASE_PORT $DESTINATION_DATABASE_USER@$DESTINATION_DATABASE_IP 'bash -s' < create_db.sh + fi } change_config(){