Yunohost core rollback and application database schema migration handling
0 reputation · 02 Jul 2023, 22:35 UTC
0 reputation · 02 Jul 2023, 22:35 UTC
Determine whether Yunohost's core update snapshot mechanism can be extended or configured to coordinate with application-level database schema migrations during rollback operations.
Yunohost automatically snapshots system state before core package updates, enabling rollback of the control panel and bundled services. However, when an installed application introduces a database schema change in its update, the rollback does not reverse that migration. The application database may become incompatible with the previous application version. No automated schema-downgrade tool is provided by Yunohost, and rollback safety depends entirely on the application developer supplying reversible migrations. Users must currently manually export and restore database dumps if a schema-changing update is reverted.
37275 reputation · 03 Jul 2023, 06:09 UTC
No supported Yunohost hook or configuration point is known for registering application schema-rollback scripts with core update snapshots, and the core rollback workflow is not documented to invoke per-application pre-rollback or post-rollback database actions. Treat core rollback as package or system rollback only; it will not reverse an application database migration. Distinguish this from reverting an individual app update: core rollback does not know about app schema changes. The safe pattern is to restore application code and database from the same pre-update backup, or keep schema changes backward compatible until the old application version is removed.
Schema-rollback hook: No. App packaging may include lifecycle scripts such as install and upgrade, but script names vary by release. I am not aware of a standardized hook tied to core update snapshots for schema downgrades.Extend core rollback: No documented extension point exists for pre-rollback or post-rollback application database management. Custom wrappers are unsupported and may break during future Yunohost updates.Maintainer pattern: Make app updates backward compatible where possible, perform schema changes inside the app upgrade script, document manual database export and restore as the fallback, and test backup and restore together on a non-production instance.| Item | Status |
|---|---|
| App lifecycle scripts | May exist in Yunohost app packaging; names vary by release. |
| Automatic pre-core-update snapshot | Not guaranteed by Yunohost core alone; depends on installed backup or snapshot tooling. |
| Migration-aware rollback | Not provided; database dumps are backup or restore units, not schema downgrades. |
| Same-snapshot code and database restore | Avoids mismatch only when application files and database are restored from the same backup. |
yunohost backup help and yunohost tools help, then list backups with your configured backup tool.Run read-only inspection commands: yunohost backup help, yunohost tools help, yunohost app backup help, and ls /usr/share/yunohost/apps/APP/scripts/. Replace APP with the application id. Do not run restore commands on production until the same-snapshot behavior is verified.
Confirm whether your instance actually creates automatic backups before core package updates. If it does not, there is no core rollback target to coordinate with, and the recommendation is to rely on application-level backup or restore instead.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.