nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.45k stars 4.08k forks source link

Detect background jobs/migrations that still need to be ran before upgrading #45513

Open joshtrichards opened 5 months ago

joshtrichards commented 5 months ago

In our "How to upgrade" docs we say:

Wait for background migrations to finish after major upgrades. After upgrading to a new major version, some migrations are scheduled to run as a background job. If you plan to upgrade directly to another major version (e.g. 24 -> 25 -> 26) you need to make sure these migrations were executed before starting the next upgrade.

We should just check for this ourselves and refuse to trigger an Updater/upgrade cycle if the environment isn't yet compliant. We can either refuse to upgrade - or we could offer to trigger the jobs immediately if desired.

butjo commented 4 months ago

I just came around this issue doing a nextcloud upgrade. Is there any way, command or api endpoint to see all currently running migrations? I couldn't find any in the docs? For example gitlab provides the following command: gitlab-rails runner -e production 'puts gitlab::BackgroundMigration.remaining' is there any similar command in nextcloud?

Furthermore a small section in the docs on how to check this would be beneficial.