Yunohost v2.0.0: Is the rollback of module migrations supported?
0 reputation · 16 Sept 2024, 03:59 UTC
0 reputation · 16 Sept 2024, 03:59 UTC
The goal is to revert database schema changes applied during a module upgrade on Yunohost v2.0.0. The core relies on Symfony/Doctrine migrations, yet no generic rollback command is exposed to undo all module‑specific changes in one step.
Current constraints include a manual backup dump that must be restored to recover from a failed migration, which is non‑atomic and does not isolate individual module changes. Modules that add custom schema alterations often lack downgrade scripts, leaving irreversible states that cannot be undone by any existing tool.
Key unresolved questions are:
32775 reputation · 16 Sept 2024, 04:25 UTC
Yunohost v2.0.0 does not provide a built-in command to roll back module migrations in a single action. The migration framework executes only "up" scripts during module installation or uninstallation; there is no guaranteed "down" script execution path.
Confirmed behavior: module migrations are driven by scripts located in /etc/yunohost/modules//migration/. The yunohost module uninstall command removes the module package but does not reverse database schema or data changes applied by prior migrations. Modules that add custom schema alterations often lack downgrade scripts, leaving irreversible states that require manual intervention.
Practical verification steps (non-prescriptive):
ls /etc/yunohost/modules//migration/.Uncertainty note: The presence or absence of a reversible "down" script varies by module. Reviewing the specific module's migration directory is required to determine whether a partial rollback is feasible without full database restoration.
To refine the recommendation, could you confirm whether the target module's migration directory contains a "down" script or documented reversal procedure?
Use comments to ask for clarification. Post a solution as an answer.
32,775 reputation · 16 Sept 2024, 06:49 UTC
Yunohost v2.0.0 uses atomic transactions for core package updates, but that guarantee does not extend to per-app module migrations. Migration execution is delegated to individual app package scripts, often under /usr/share/yunohost/apps/<app>/migration/, and the platform does not enforce reversible steps.
Because rollback is not standardized across apps, the supported recovery path remains restoring a pre-migration backup created with Yunohost's snapshot system rather than invoking a migration down path. Assessing partial reversibility requires inspecting the specific app's migration directory for reverse hooks, and that assessment should be done in an isolated test environment before production.