diff --git a/scripts/upgrade b/scripts/upgrade index 24a43e1..e91b2d4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -79,6 +79,11 @@ ynh_print_info "Backing up the app before upgrading (may take a while)..." # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { + if [ $migration_process -eq 1 ]; then + yunohost app remove $app + # Reload some values changed by the migration process + app=$YNH_APP_INSTANCE_NAME + fi # restore it if the upgrade fails ynh_restore_upgradebackup } @@ -90,12 +95,11 @@ ynh_abort_if_errors #================================================= ynh_handle_app_migration "spip2" "spip2_migration" -if [ $migration_process -eq 1 ] -then - # If a migration has been perform - # Reload some values changed by the migration process - final_path=$(ynh_app_setting_get $app final_path) - db_name=$(ynh_app_setting_get $app db_name) +if [ $migration_process -eq 1 ]; then + # If a migration has been perform + # Reload some values changed by the migration process + final_path=$(ynh_app_setting_get $app final_path) + db_name=$(ynh_app_setting_get $app db_name) fi #=================================================