From 512f1e558d45708aca04987255e42c3399f638e1 Mon Sep 17 00:00:00 2001 From: ljf Date: Fri, 9 Dec 2022 18:47:56 +0100 Subject: [PATCH] Change upstream to Yakforms, handle migration. --- conf/extra_php-fpm.conf | 0 manifest.toml | 2 +- scripts/upgrade | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 conf/extra_php-fpm.conf diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf new file mode 100644 index 0000000..e69de29 diff --git a/manifest.toml b/manifest.toml index a4f2089..9f9e2c6 100644 --- a/manifest.toml +++ b/manifest.toml @@ -13,7 +13,7 @@ maintainers = [] [upstream] license = "GPL-2.0-only" -website = "https://framaforms.org" +website = "https://yakforms.org" code = "https://framagit.org/yakforms/yakforms" fund = "https://soutenir.framasoft.org" diff --git a/scripts/upgrade b/scripts/upgrade index b9e1bbe..aa46e74 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,6 +12,25 @@ source /usr/share/yunohost/helpers #================================================= # ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 +#================================================= +# Framaforms 2 Yakforms Backup +#================================================= +upgrade_to_yakforms=true + +if [ "$upgrade_to_yakforms" = false ]; then + pushd "$install_dir" + ynh_exec_as "$app" env "PATH=$PATH" "php$phpversion" framaforms2yakforms.php backup + _ynh_exec_with_drush_php drush "@$app" dis framaforms + _ynh_exec_with_drush_php drush "@$app" pm-uninstall framaforms + _ynh_exec_with_drush_php drush "@$app" dis framaforms_share_results + _ynh_exec_with_drush_php drush "@$app" pm-uninstall framaforms_share_results + _ynh_exec_with_drush_php drush "@$app" dis framaforms_public_results + _ynh_exec_with_drush_php drush "@$app" pm-uninstall framaforms_public_results + _ynh_exec_with_drush_php drush "@$app" dis framaforms_spam + _ynh_exec_with_drush_php drush "@$app" pm-uninstall framaforms_spam + popd +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -33,6 +52,21 @@ ynh_script_progression --message="Upgrading Composer..." --weight=3 ynh_install_composer --phpversion="$phpversion" --workdir="$install_dir/.composer" +#================================================= +# Framaforms 2 Yakforms Restore +#================================================= + +if [ "$upgrade_to_yakforms" = true ]; then + pushd "$install_dir" + _ynh_exec_with_drush_php drush "@$app" en yakforms + _ynh_exec_with_drush_php drush "@$app" dis yakforms_share_results + _ynh_exec_with_drush_php drush "@$app" dis yakforms_public_results + _ynh_exec_with_drush_php drush "@$app" dis yakforms_spam + ynh_exec_as "$app" env "PATH=$PATH" "php$phpversion" framaforms2yakforms.php restore + ynh_exec_as "$app" env "PATH=$PATH" "php$phpversion" framaforms2yakforms.php clean + popd +fi + #================================================= # UPGRADE DRUPAL #=================================================