From 349dff22fca32422b31a73a19fd80ef9984c7a62 Mon Sep 17 00:00:00 2001 From: rodinux Date: Sun, 15 Jan 2023 16:30:16 +0100 Subject: [PATCH] comment db migration on experimental_heper --- scripts/experimental_helper.sh | 46 +++++++++++++++++----------------- scripts/upgrade | 5 ---- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/scripts/experimental_helper.sh b/scripts/experimental_helper.sh index b51cda3..57a6e78 100644 --- a/scripts/experimental_helper.sh +++ b/scripts/experimental_helper.sh @@ -192,35 +192,35 @@ ynh_handle_app_migration () { # MOVE THE DATABASE #================================================= - db_pwd=$(ynh_app_setting_get $old_app mysqlpwd) - db_name=$dbname + # db_pwd=$(ynh_app_setting_get $old_app mysqlpwd) + # db_name=$dbname - # Check if a database exists before trying to move it - local mysql_root_password=$(cat $MYSQL_ROOT_PWD_FILE) - if [ -n "$db_name" ] && mysqlshow -u root -p$mysql_root_password | grep -q "^| $db_name" - then - new_db_name=$(ynh_sanitize_dbid $new_app) - echo "Rename the database $db_name to $new_db_name" >&2 + # # Check if a database exists before trying to move it + # local mysql_root_password=$(cat $MYSQL_ROOT_PWD_FILE) + # if [ -n "$db_name" ] && mysqlshow -u root -p$mysql_root_password | grep -q "^| $db_name" + # then + # new_db_name=$(ynh_sanitize_dbid $new_app) + # echo "Rename the database $db_name to $new_db_name" >&2 - local sql_dump="/tmp/${db_name}-$(date '+%s').sql" + # local sql_dump="/tmp/${db_name}-$(date '+%s').sql" - # Dump the old database - ynh_mysql_dump_db "$db_name" > "$sql_dump" + # # Dump the old database + # ynh_mysql_dump_db "$db_name" > "$sql_dump" - # Create a new database - ynh_mysql_setup_db $new_db_name $new_db_name $db_pwd - # Then restore the old one into the new one - ynh_mysql_connect_as $new_db_name $db_pwd $new_db_name < "$sql_dump" + # # Create a new database + # ynh_mysql_setup_db $new_db_name $new_db_name $db_pwd + # # Then restore the old one into the new one + # ynh_mysql_connect_as $new_db_name $db_pwd $new_db_name < "$sql_dump" - # Remove the old database - ynh_mysql_remove_db $db_name $db_name - # And the dump - ynh_secure_remove --file="$sql_dump" + # # Remove the old database + # ynh_mysql_remove_db $db_name $db_name + # # And the dump + # ynh_secure_remove --file="$sql_dump" - # Update the value of $db_name - db_name=$new_db_name - ynh_app_setting_set $new_app db_name $db_name - fi + # # Update the value of $db_name + # db_name=$new_db_name + # ynh_app_setting_set $new_app db_name $db_name + # fi #================================================= # CHANGE THE FAKE DEPENDENCIES PACKAGE diff --git a/scripts/upgrade b/scripts/upgrade index afad24f..5ae5714 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -76,13 +76,8 @@ fi ynh_handle_app_migration --migration_id=garradin --migration_list=garradin_migrations if [[ $migration_process -eq 1 ]]; then - # Reload variables - #dbname=$app - #db_user=$app - # Replace the user ynh_system_user_delete --username="$old_app" - #test getent passwd "$app" &>/dev/null || \ useradd -d "$final_path" --system --user-group "$app" || \ ynh_die --message "Unable to create $app system account"