Protéger les données persistantes à la mise à jour

This commit is contained in:
OverSu 2026-09-07 15:17:54 +02:00 • committed by GitHub
commit 591cbf5cc4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,31 +4,41 @@
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE FILES AND DATA
#================================================= #=================================================
ynh_script_progression "Restoring the app main directory..."
ynh_script_progression "Restoring application files..."
ynh_restore "$install_dir" ynh_restore "$install_dir"
ynh_restore "$data_dir"
#================================================= #=================================================
# RESTORE SYSTEM CONFIGURATION # RESTORE SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_script_progression "Restoring system configurations related to $app..." ynh_script_progression "Restoring system configurations related to $app..."
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore "/etc/php/$php_version/fpm/pool.d/$app.conf" ynh_restore "/etc/php/$php_version/fpm/pool.d/$app.conf"
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" migrate_legacy_data
#================================================= for migrated_path in "$install_dir/data" "$install_dir/storage" "$install_dir/public/media"; do
# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE if [[ -d "$migrated_path" && ! -L "$migrated_path" ]]; then
#================================================= ynh_safe_rm "$migrated_path"
ynh_script_progression "Reloading NGINX web server and $app's service..." fi
done
prepare_persistent_paths
install_yunohost_logo
ynh_exec_as_app php "$install_dir/scripts/migrate.php"
repair_and_verify_permissions
ynh_systemctl --service="php$php_version-fpm" --action=reload ynh_systemctl --service="php$php_version-fpm" --action=reload
ynh_systemctl --service=nginx --action=reload ynh_systemctl --service=nginx --action=reload
#================================================= #=================================================