diff --git a/manifest.toml b/manifest.toml index bf114e5..cbd1b01 100644 --- a/manifest.toml +++ b/manifest.toml @@ -78,6 +78,14 @@ ram.runtime = "50M" autoupdate.strategy = "latest_gitlab_release" + [resources.sources.migration_script] + url = "https://framagit.org/yakforms/yakforms/-/raw/v1.1/framaforms2yakforms.php" + sha256 = "58a2e7378461dc5db70f59d69d37c0d6bd34eed224872151db5a794fdf33d07a" + format = "whatever" + extract = false + rename = "framaforms2yakforms.php" + prefetch = false + [resources.system_user] [resources.install_dir] diff --git a/scripts/upgrade b/scripts/upgrade index b906109..11cab9f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,8 +22,9 @@ else upgrade_to_yakforms=false fi -if [ "$upgrade_to_yakforms" = false ]; then +if [ "$upgrade_to_yakforms" = true ]; then pushd "$install_dir" + ynh_setup_source --source_id="migration_script" --dest_dir="$install_dir/app" 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