Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade: attempt to restore backup only if it was correctly saved #92

Merged
merged 1 commit into from
Feb 5, 2018

Conversation

kemenaran
Copy link
Collaborator

In the current state, an upgrade may end up removing the app.

This is because the new upgrade script backups the app before upgrading – and attempts to restore the backup in case of upgrade failure. This is a great safety feature provided by Yunohost, which really makes upgrades safer.

However, if an app is upgraded from a previous version where it did support backup but not restore, Yunohost will happily:

  1. back up the app,
  2. attempt to upgrade,
  3. in case of error, start attempting to restore the backup,
  4. delete the app entirely to make room for the to-be-restored backup,
  5. fail at restoring because no restore script is present.

To fix this, the script now checks if the backup went successfully. When an error occurs, it attempts to restore the backup only if the backup process was successful.

Ref #90

@kemenaran kemenaran merged commit 652c3a8 into master Feb 5, 2018
@kemenaran kemenaran deleted the fix-upgrade-failure branch February 13, 2018 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant