From bf741e8de5b521ceec35201720125b71893d15d1 Mon Sep 17 00:00:00 2001 From: Daniel Quathamer Date: Wed, 29 Jul 2026 07:27:04 +0200 Subject: [PATCH] Webapp-Migration vereinfacht --- webapps_migration/migrate_superx.conf | 16 ++++++++-------- webapps_migration/migrate_superx_webapp.sh | 15 ++++++++++++++- 2 files changed, 22 insertions(+), 9 deletions(-) mode change 100644 => 100755 webapps_migration/migrate_superx_webapp.sh diff --git a/webapps_migration/migrate_superx.conf b/webapps_migration/migrate_superx.conf index 04e011c..d6b72c5 100644 --- a/webapps_migration/migrate_superx.conf +++ b/webapps_migration/migrate_superx.conf @@ -18,11 +18,9 @@ # Produktiv mit Rechte-/Owner-Anpassung meist: # sudo ./migrate_superx_webapp.sh -SQL_ENV="/home/superx/db/bin/SQL_ENV" - # full = Webapp kopieren + db kopieren/verschieben # db_only = nur db in bestehende/konfigurierte Webapp kopieren/verschieben -MIGRATION_MODE="full" +MIGRATION_MODE="db_only" # copy = db per rsync kopieren # move = db per mv verschieben, Ziel-db darf noch nicht existieren @@ -31,7 +29,9 @@ DB_TRANSFER_MODE="copy" # Standardziel: Webapp unter /home statt direkt unter /var/lib/tomcat*/webapps # Bei MIGRATION_MODE=db_only kann TARGET_WEBAPP="auto" gesetzt werden, # dann wird WEBAPP aus der geladenen SQL_ENV verwendet. -TARGET_WEBAPP="/home/superx/webapps/superx" + + +#TARGET_WEBAPP="/home/superx/webapps/superx" # Benutzer/Gruppe fuer die Zielstruktur. # Ersetzt die vorherigen tomcat-/superx-spezifischen Variablennamen. @@ -58,17 +58,17 @@ DRY_RUN="false" # WEBAPP_USER automatisch zur WEBAPP_GROUP hinzufuegen, falls noetig. # Benoetigt root, wenn die Mitgliedschaft fehlt. -ADD_WEBAPP_USER_TO_GROUP="true" +ADD_WEBAPP_USER_TO_GROUP="false" CREATE_GROUP_IF_MISSING="false" UPDATE_SQL_ENV="true" -SET_RIGHTS="true" +SET_RIGHTS="false" # auto = root setzt chown; gleicher User mit passender Gruppe ueberspringt chown # true = chown immer versuchen # false = kein chown -SET_OWNER="auto" -SET_CHMOD="true" +SET_OWNER="false" +SET_CHMOD="false" # Sicherheitspruefung gegen erneute Migration bereits migrierter Strukturen. FORCE_ALREADY_MIGRATED="false" diff --git a/webapps_migration/migrate_superx_webapp.sh b/webapps_migration/migrate_superx_webapp.sh old mode 100644 new mode 100755 index c0ffa91..a9b87ee --- a/webapps_migration/migrate_superx_webapp.sh +++ b/webapps_migration/migrate_superx_webapp.sh @@ -53,8 +53,21 @@ USAGE load_config() { [ -f "$CONFIG_FILE" ] || { usage; fail "Config-Datei nicht gefunden: $CONFIG_FILE"; } # shellcheck disable=SC1090 - . "$CONFIG_FILE" + + if [ "$SQL_ENV" == "" ] + then + SQL_ENV=`which SQL_ENV` + + fi + if [ "$TARGET_WEBAPP" == "" ] + then + TARGET_WEBAPP=$WEBAPP + + fi + echo "Lade $CONFIG_FILE" + . "$CONFIG_FILE" + #echo $SQL_ENV : "${SQL_ENV:?SQL_ENV ist nicht gesetzt}" : "${TARGET_WEBAPP:?TARGET_WEBAPP ist nicht gesetzt}" : "${WEBAPP_USER:?WEBAPP_USER ist nicht gesetzt}"