Update from old version on PHP 8.0 system (19 > 26)?

Hey, we need to update a very old version of NextCloud installation to a newer one.
The problem: server runs on PHP 8.0 and we cannot reactivate PHP 7.4.
The necessary version before upgrading to the newer does not support PHP 8.0 :frowning:

We have 19.0.0. installed (yeah, quite old…) and wanted to upgrade to 26.
But update process wants us to install step-by-step. But the next version (20.0.0) does not run with PHP 8.0.

Any ideas how to solve that?

You cannot skip major versions ;-(

Official way: Set up a virtual server with php7.4, migrate the NC setup into this virtual server (in theory the database and the folder structure should be enough to do the job, you don’t need to copy all the data). Once you are on a version that runs with php 8.0 (NC 21+), you can migrate the setup back to your server (just the database, code files, config files, the data folder hasn’t been touched). Once you are back on your server, after each upgrade, I’d login, update the apps (so they update their data in the database).

Inofficial way: disable the php version check / skip a major release
Perhaps for the upgrade procedure you don’t have very specific functions that won’t work on php 8.0. Don’t mess around long with NC20 and go to NC21.
In both ways, you need to modify the code a bit. The risk is that something is not working or is not carried out correctly. If that pops up directly, it’s not a problem. If it stays hidden and some external shares … whatever fails at some strange point in some time, this can become tricky. For that reason, I would test everything after upgrading (that all the shares are still working, special apps, …).

Unfortunately, it is a mess when you try to update much later. It is much easier if you keep it always updated and you don’t fall back so much. E.g. you should have updated on your old system as far as the php version allowed you to upgrade before moving to the new system.

2 Likes

Thanks for the input. That sounds good. Next time we will update more often.

How can I ignore the message “Exception: Updates between multiple major versions and downgrades are unsupported.” to update from 19 to 21?
I only found the PHP check option… but updating to 20 did not work with PHP 8.0. Did not run…

UPDATE: seems like I found it in version.php ($OC_VersionCanBeUpgradedFrom). But update did not work fine…

InvalidArgumentException: Migration step ‘OCA\WorkflowEngine\Migration\Version2200Date20210805101925’ is unknown

Detailed log:
Update vorbereiten

Log-Level auf “debug” gesetzt

Wartungsmodus eingeschaltet

Reparaturschritt: Repair MySQL collation

Reparaturinformation: All tables already have the correct collation → nothing to do

Reparaturschritt: Repair SQLite autoincrement

Reparaturschritt: Copy data from accounts table when migrating from ownCloud

Reparaturschritt: Drop account terms table when migrating from ownCloud

Das Datenbankschema wird aktualisiert

Datenbank aktualisiert

“federation” aktualisiert auf 1.11.0

“lookup_server_connector” aktualisiert auf 1.9.0

Reparaturschritt: Update OAuth token expiration times

“oauth2” aktualisiert auf 1.9.0

“password_policy” aktualisiert auf 1.11.0

“files” aktualisiert auf 1.16.0

“activity” aktualisiert auf 2.14.3

“cloud_federation_api” aktualisiert auf 1.4.0

Reparaturschritt: Fix component of birthday calendars

Reparaturinformation: 1 birthday calendars updated.

Reparaturschritt: Regenerating birthday calendars to use new icons and fix old birthday events without year

Reparaturinformation: Adding background jobs to regenerate birthday calendar

Reparaturschritt: Fix broken values of calendar objects

[0 / 0]: Fix broken values of calendar objects

Reparaturschritt: Registering building of calendar search index as background job

Reparaturinformation: Add background job

Reparaturschritt: Register building of social profile search index as background job

Reparaturschritt: Registering background jobs to update cache for webcal calendars

Reparaturinformation: Added 0 background jobs to update webcal calendars

Reparaturschritt: Registering building of calendar reminder index as background job

Reparaturinformation: Add background job

Reparaturschritt: Clean up orphan event and contact data

Reparaturinformation: 0 events without a calendar have been cleaned up

Reparaturinformation: 0 properties without an events have been cleaned up

Reparaturinformation: 0 changes without a calendar have been cleaned up

Reparaturinformation: 0 cached events without a calendar subscription have been cleaned up

Reparaturinformation: 0 changes without a calendar subscription have been cleaned up

Reparaturinformation: 0 contacts without an addressbook have been cleaned up

Reparaturinformation: 0 properties without a contact have been cleaned up

Reparaturinformation: 0 changes without an addressbook have been cleaned up

Reparaturschritt: Remove activity entries of private events

Reparaturinformation: Removed 0 activity entries

“dav” aktualisiert auf 1.17.1

Reparaturschritt: Fix the share type of guest shares when migrating from ownCloud

Reparaturschritt: Copy the share password into the dedicated column

Reparaturschritt: Set existing shares as accepted

“files_sharing” aktualisiert auf 1.13.1

“files_trashbin” aktualisiert auf 1.11.0

“files_versions” aktualisiert auf 1.14.0

“sharebymail” aktualisiert auf 1.11.0

InvalidArgumentException: Migration step ‘OCA\WorkflowEngine\Migration\Version2200Date20210805101925’ is unknown

After re-trying, the list is shorter, but always ends with the same:

  • Update vorbereiten

  • Log-Level auf “debug” gesetzt

  • Wartungsmodus eingeschaltet

  • Reparaturschritt: Repair MySQL collation

  • Reparaturinformation: All tables already have the correct collation → nothing to do

  • Reparaturschritt: Repair SQLite autoincrement

  • Reparaturschritt: Copy data from accounts table when migrating from ownCloud

  • Reparaturschritt: Drop account terms table when migrating from ownCloud

  • Das Datenbankschema wird aktualisiert

  • Datenbank aktualisiert

InvalidArgumentException: Migration step ‘OCA\WorkflowEngine\Migration\Version2200Date20210805101925’ is unknown

I have a file with name Version2200Date20210805101925.php in the folder “apps/workflowengine/lib/Migration”
When I delete the file it seems fine, but code integrity check fails…

Update vorbereiten

Log-Level auf “debug” gesetzt

Wartungsmodus eingeschaltet

Reparaturschritt: Repair MySQL collation

Reparaturinformation: All tables already have the correct collation → nothing to do

Reparaturschritt: Repair SQLite autoincrement

Reparaturschritt: Copy data from accounts table when migrating from ownCloud

Reparaturschritt: Drop account terms table when migrating from ownCloud

Das Datenbankschema wird aktualisiert

Datenbank aktualisiert

Reparaturschritt: Populating added database structures for workflows

“workflowengine” aktualisiert auf 2.3.0

“comments” aktualisiert auf 1.11.0

“firstrunwizard” aktualisiert auf 2.10.0

“nextcloud_announcements” aktualisiert auf 1.10.0

“notifications” aktualisiert auf 2.9.0

“systemtags” aktualisiert auf 1.11.0

“theming” aktualisiert auf 1.12.0

Reparaturschritt: Migrate old user config

[1 / 0]: Migrate old user config

[2 / 0]: Migrate old user config

[3 / 0]: Migrate old user config

[4 / 0]: Migrate old user config

[5 / 0]: Migrate old user config

[6 / 0]: Migrate old user config

[7 / 0]: Migrate old user config

[8 / 0]: Migrate old user config

[8 / 8]: Migrate old user config

“accessibility” aktualisiert auf 1.7.0

“contactsinteraction” aktualisiert auf 1.2.0

“federatedfilesharing” aktualisiert auf 1.11.0

“files_pdfviewer” aktualisiert auf 2.1.0

“files_rightclick” aktualisiert auf 1.0.0

“files_videoplayer” aktualisiert auf 1.10.0

“logreader” aktualisiert auf 2.6.0

“photos” aktualisiert auf 1.3.0

“privacy” aktualisiert auf 1.5.0

“provisioning_api” aktualisiert auf 1.11.0

“recommendations” aktualisiert auf 1.0.0

“serverinfo” aktualisiert auf 1.11.0

“settings” aktualisiert auf 1.3.0

Reparaturschritt: Switches from default updater server to the customer one if a valid subscription is available

“support” aktualisiert auf 1.4.0

Reparaturschritt: Send an admin notification if monthly report is disabled

“survey_client” aktualisiert auf 1.9.0

“text” aktualisiert auf 3.2.0

Reparaturschritt: Add background job to check for backup codes

“twofactor_backupcodes” aktualisiert auf 1.10.0

“updatenotification” aktualisiert auf 1.11.0

“viewer” aktualisiert auf 1.5.0

Suche nach einer Aktualisierung für die App “accessibility” im App-Store

App-Store auf Aktualisierung für die App “accessibility” geprüft

Suche nach einer Aktualisierung für die App “activity” im App-Store

App-Store auf Aktualisierung für die App “activity” geprüft

Suche nach einer Aktualisierung für die App “cloud_federation_api” im App-Store

App-Store auf Aktualisierung für die App “cloud_federation_api” geprüft

Suche nach einer Aktualisierung für die App “comments” im App-Store

App-Store auf Aktualisierung für die App “comments” geprüft

Suche nach einer Aktualisierung für die App “contactsinteraction” im App-Store

App-Store auf Aktualisierung für die App “contactsinteraction” geprüft

Suche nach einer Aktualisierung für die App “dav” im App-Store

App-Store auf Aktualisierung für die App “dav” geprüft

Suche nach einer Aktualisierung für die App “federatedfilesharing” im App-Store

App-Store auf Aktualisierung für die App “federatedfilesharing” geprüft

Suche nach einer Aktualisierung für die App “federation” im App-Store

App-Store auf Aktualisierung für die App “federation” geprüft

Suche nach einer Aktualisierung für die App “files” im App-Store

App-Store auf Aktualisierung für die App “files” geprüft

Suche nach einer Aktualisierung für die App “files_pdfviewer” im App-Store

App-Store auf Aktualisierung für die App “files_pdfviewer” geprüft

Suche nach einer Aktualisierung für die App “files_rightclick” im App-Store

App-Store auf Aktualisierung für die App “files_rightclick” geprüft

Suche nach einer Aktualisierung für die App “files_sharing” im App-Store

App-Store auf Aktualisierung für die App “files_sharing” geprüft

Suche nach einer Aktualisierung für die App “files_trashbin” im App-Store

App-Store auf Aktualisierung für die App “files_trashbin” geprüft

Suche nach einer Aktualisierung für die App “files_versions” im App-Store

App-Store auf Aktualisierung für die App “files_versions” geprüft

Suche nach einer Aktualisierung für die App “files_videoplayer” im App-Store

App-Store auf Aktualisierung für die App “files_videoplayer” geprüft

Suche nach einer Aktualisierung für die App “firstrunwizard” im App-Store

App-Store auf Aktualisierung für die App “firstrunwizard” geprüft

Suche nach einer Aktualisierung für die App “logreader” im App-Store

App-Store auf Aktualisierung für die App “logreader” geprüft

Suche nach einer Aktualisierung für die App “lookup_server_connector” im App-Store

App-Store auf Aktualisierung für die App “lookup_server_connector” geprüft

Suche nach einer Aktualisierung für die App “nextcloud_announcements” im App-Store

App-Store auf Aktualisierung für die App “nextcloud_announcements” geprüft

Suche nach einer Aktualisierung für die App “notifications” im App-Store

App-Store auf Aktualisierung für die App “notifications” geprüft

Suche nach einer Aktualisierung für die App “oauth2” im App-Store

App-Store auf Aktualisierung für die App “oauth2” geprüft

Suche nach einer Aktualisierung für die App “password_policy” im App-Store

App-Store auf Aktualisierung für die App “password_policy” geprüft

Suche nach einer Aktualisierung für die App “photos” im App-Store

App-Store auf Aktualisierung für die App “photos” geprüft

Suche nach einer Aktualisierung für die App “privacy” im App-Store

App-Store auf Aktualisierung für die App “privacy” geprüft

Suche nach einer Aktualisierung für die App “provisioning_api” im App-Store

App-Store auf Aktualisierung für die App “provisioning_api” geprüft

Suche nach einer Aktualisierung für die App “recommendations” im App-Store

App-Store auf Aktualisierung für die App “recommendations” geprüft

Suche nach einer Aktualisierung für die App “serverinfo” im App-Store

App-Store auf Aktualisierung für die App “serverinfo” geprüft

Suche nach einer Aktualisierung für die App “settings” im App-Store

App-Store auf Aktualisierung für die App “settings” geprüft

Suche nach einer Aktualisierung für die App “sharebymail” im App-Store

App-Store auf Aktualisierung für die App “sharebymail” geprüft

Suche nach einer Aktualisierung für die App “support” im App-Store

App-Store auf Aktualisierung für die App “support” geprüft

Suche nach einer Aktualisierung für die App “survey_client” im App-Store

App-Store auf Aktualisierung für die App “survey_client” geprüft

Suche nach einer Aktualisierung für die App “systemtags” im App-Store

App-Store auf Aktualisierung für die App “systemtags” geprüft

Suche nach einer Aktualisierung für die App “text” im App-Store

App-Store auf Aktualisierung für die App “text” geprüft

Suche nach einer Aktualisierung für die App “theming” im App-Store

App-Store auf Aktualisierung für die App “theming” geprüft

Suche nach einer Aktualisierung für die App “twofactor_backupcodes” im App-Store

App-Store auf Aktualisierung für die App “twofactor_backupcodes” geprüft

Suche nach einer Aktualisierung für die App “updatenotification” im App-Store

App-Store auf Aktualisierung für die App “updatenotification” geprüft

Suche nach einer Aktualisierung für die App “viewer” im App-Store

App-Store auf Aktualisierung für die App “viewer” geprüft

Suche nach einer Aktualisierung für die App “workflowengine” im App-Store

App-Store auf Aktualisierung für die App “workflowengine” geprüft

Reparaturschritt: Repair MySQL collation

Reparaturinformation: All tables already have the correct collation → nothing to do

Reparaturschritt: Repair mime types

Reparaturschritt: Clean tags and favorites

Reparaturinformation: 0 tags of deleted users have been removed.

Reparaturinformation: 0 tags for delete files have been removed.

Reparaturinformation: 0 tag entries for deleted tags have been removed.

Reparaturinformation: 1 tags with no entries have been removed.

Reparaturschritt: Repair invalid shares

Reparaturschritt: Move .step file of updater to backup location

Reparaturschritt: Add move avatar background job

Reparaturinformation: Add background job

Reparaturschritt: Add preview cleanup background jobs

Reparaturschritt: Fix potential broken mount points

Reparaturinformation: No mounts updated

Reparaturschritt: Repair language codes

Reparaturschritt: Install new core bundle components

Reparaturschritt: Add log rotate job

Reparaturschritt: Clear frontend caches

Reparaturinformation: Image cache cleared

Reparaturinformation: SCSS cache cleared

Reparaturinformation: JS cache cleared

Reparaturschritt: Clear every generated avatar on major updates

Reparaturschritt: Add preview background cleanup job

Reparaturschritt: Queue a one-time job to cleanup old backups of the updater

Reparaturschritt: Cleanup invalid photocache files for carddav

Reparaturschritt: Add background job to cleanup login flow v2 tokens

Reparaturschritt: Remove potentially over exposing share links

Reparaturinformation: No need to remove link shares.

Reparaturschritt: Clear access cache of projects

Reparaturschritt: Reset generated avatar flag

Reparaturschritt: Keep legacy encryption enabled

Reparaturschritt: Check encryption key format

Reparaturschritt: Remove old dashboard app config data

Reparaturschritt: Add job to cleanup the bruteforce entries

Reparaturschritt: Queue a one-time job to check for user uploaded certificates

Reparaturschritt: Repair DAV shares

Reparaturinformation: Repaired DAV group shares

Code-Integrität wird ßberprßft

Es ist ein Fehler aufgetreten

version.php → version of the code of currently used NC
config.php → version of the “database”, after the upgrade process is run, the version should be increased to match the one from version.php

In the database, there might be something as well. You can try to modify the version in config.php to NC 20, but I’m not sure if that works.

For the workflow table, if you haven’t been using before the workflow app, and there is nothing in the tables. Supposing you have a good backup and ideally can create some snapshots, you could delete the table and hope that it will create a new correct one. Alternative, set up a separate NC version 21, and then copy the table from there. If you use the app and there is some data… then it’s more tricky…