Skip to content

Conversation

@szaimen
Copy link
Collaborator

@szaimen szaimen commented Nov 18, 2021

Close #2113

Disclaimer: I didn't test this.

Signed-off-by: szaimen [email protected]

@enoch85
Copy link
Member

enoch85 commented Nov 19, 2021

Aah, ok, so we'll let Nextcloud handle this, and only copy unsupported apps to the apps folder for easier re-anbling by the user?

Are you sure we don't need to restore apps-status and all that?

@szaimen
Copy link
Collaborator Author

szaimen commented Nov 19, 2021

Aah, ok, so we'll let Nextcloud handle this, and only copy unsupported apps to the apps folder for easier re-anbling by the user?

Are you sure we don't need to restore apps-status and all that?

Yes, thats excactly what nextcloud/server#29020 has finally fixed ;)

@enoch85
Copy link
Member

enoch85 commented Nov 19, 2021

Tested and working!

@enoch85 enoch85 merged commit c667c74 into master Nov 19, 2021
@delete-merged-branch delete-merged-branch bot deleted the enh/2113/simplify-apps-reenabling branch November 19, 2021 10:51
@enoch85
Copy link
Member

enoch85 commented Jan 30, 2022

@szaimen Been having this in master now for a while and I have noticed that even core apps are missing/not enabled during update.

We now got several reports regarding this, so I really think we should improve this.

Something like:

  1. Backup all current apps before the upgrade
  2. Do the update
  3. Check which apps that aren't enabled from the list in 1
  4. Try to enabled all apps from the list in 3
  5. If it doesn't succeed, ask to restore them (disabled)

That would guarantee that users easily can at least decide to enable the apps again through the GUI after a major upgrade were multiple apps are disabled. I don't trust Nextclouds app update/restore mechanism,.. :)

@szaimen
Copy link
Collaborator Author

szaimen commented Jan 31, 2022

I am not sure about this. Shouldn't

vm/nextcloud_update.sh

Lines 1076 to 1096 in 0a3f0c6

# If the app isn't installed (maybe because it's incompatible), then at least restore from backup and make sure it's disabled
BACKUP_APPS="$(find "$BACKUP/apps" -maxdepth 1 -mindepth 1 -type d)"
mapfile -t BACKUP_APPS <<< "$BACKUP_APPS"
for app in "${BACKUP_APPS[@]}"
do
app="${app##"$BACKUP/apps/"}"
if ! [ -d "$NC_APPS_PATH/$app" ] && [ -d "$BACKUP/apps/$app" ]
then
if yesno_box_no "$app couln't be installed. Do you want to restore it from backup?\n\nWARNING: It may result in failed integrity checks."
then
print_text_in_color "$ICyan" "Restoring $app from $BACKUP/apps..."
rsync -Aaxz "$BACKUP/apps/$app" "$NC_APPS_PATH/"
bash "$SECURE"
nextcloud_occ_no_check app:disable "$app"
# Don't execute the update before all cronjobs are finished
check_running_cronjobs
# Execute the update
nextcloud_occ upgrade
fi
fi
done
already do as suggested?

@enoch85
Copy link
Member

enoch85 commented Jan 31, 2022

You're right, sorry should have tested first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve apps re-enabling

3 participants