Error while upgrading (mistakenly from 18 to 20)

Hello,
i have a nextcloud installation via docker. I can share the docker-compose.yaml if needed, but the issue is: I accidentally switched from version 18 to 20. Now the version 20 refuses to run because the upgrade between non-consecutive versions is unsupported, but reverting the docker image of nextcloud to 18 doesn’t work either because the data version was somehow marked as 20 (I get the following error message: in the logfile Can't start Nextcloud because the version of the data (20.0.5.2) is higher than the docker image version (18.0.6.0) and downgrading is not supported. Are you sure you have pulled the newest image version?).
What can I do to recover the situation?

Thanks
Stefano

P.S. I can add that my latest sql backup is quite old and that all I care about are the file backups and none of the app data.

Ciao Stefano,

fun to see you on the other side of the internet… :slight_smile:

Interestingly the database seems to have been converted just fine, at least it reports the current version. Have you tried (after backup…) to manually change the version string in your config.php before attempting to run NC 20?

/Simon

Hi Simon,
you always pop up in interesting places… :slight_smile:
I finally fixed the issue by tricking nextcloud: I assumed that the first thing it did was to mark the new version as “20” and then it stopped, so I manually edited version.php to make it “19”, then deployed version 19 with docker and it happily did the migration 18->19, then I updated all the apps and carried on to 20.

For the record, I pretended it was 19.0.3 installed (see below).

<?php 
$OC_Version = array(19,0,3,1);
$OC_VersionString = '19.0.3';
$OC_Edition = '';
$OC_Channel = 'stable';
$OC_VersionCanBeUpgradedFrom = array (
  'nextcloud' => 
  array (
    '18.0' => true,
    '19.0' => true,
  ),
  'owncloud' => 
  array (
  ),
);
$OC_Build = '2020-09-09T11:44:22+00:00    02a6cac39ddd619b2a0710e3fba703f3d72ee13d';
$vendor = 'nextcloud';

I’m happy to hear things have worked out! :slight_smile: