# Can't start Nextcloud because the version of the data is higher than the docker image version and downgrading is not supported

**URL:** <https://help.nextcloud.com/t/cant-start-nextcloud-because-the-version-of-the-data-is-higher-than-the-docker-image-version-and-downgrading-is-not-supported/109438>\
**Category:** 📦 Appliances (Docker, Snappy, VM, NCP, AIO)\
**Tags:** docker, nc19\
**Created:** [February 28, 2021, 7:22pm UTC](https://help.nextcloud.com/t/cant-start-nextcloud-because-the-version-of-the-data-is-higher-than-the-docker-image-version-and-downgrading-is-not-supported/109438 "2021-02-28T19:22:34Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![reibuehl](https://help.nextcloud.com/letter_avatar/reibuehl/32/5_5575768a8748004e209b776fc1b2916d.png) [@reibuehl](https://help.nextcloud.com/u/reibuehl)\
**Post date:** [February 28, 2021, 7:22pm UTC](https://help.nextcloud.com/t/cant-start-nextcloud-because-the-version-of-the-data-is-higher-than-the-docker-image-version-and-downgrading-is-not-supported/109438/1 "2021-02-28T19:22:34Z")

</div>

Nextcloud version _(eg, 20.0.5)_: `19.0.3.1`  
Operating system and version _(eg, Ubuntu 20.04)_: `Docker Image 19.0.3.1`  
Apache or nginx version _(eg, Apache 2.4.25)_: `Docker Image 19.0.3.1`  
PHP version _(eg, 7.4)_: `Docker Image 19.0.3.1`

The issue you are facing:  
I accidentally pulled the v21 docker image while my NC installation was still 19.0.3.1. After noticing the error, I followed the advice from the linked how-to thread [Updates between multiple major versions are unsupported - #27](https://help.nextcloud.com/t/updates-between-multiple-major-versions-are-unsupported/7094/27) and tried to upgrade to the latest 19.x first to upgrade to 20 and later 21.

Unfortunately I now get the error message `Can't start Nextcloud because the version of the data (21.0.0.18) is higher than the docker image version (19.0.9.1) and downgrading is not supported. Are you sure you have pulled the newest image version?` in the logs and doesn’t startup at all.

If I try the to go to the v21 Docker image - since the log claims that the data is already v21, the container starts and I get the upgrade to v21 browser page but when I start the upgrade, it fails with `Exception: Updates between multiple major versions and downgrades are unsupported.`

Is there a way to recover from this?

The output of your config.php file in `/path/to/nextcloud` (make sure you remove any identifiable information!):

```auto
<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'instanceid' => '<removed>',
  'passwordsalt' => '<removed>',
  'secret' => '<removed>',
  'trusted_domains' => 
  array (
    0 => '<removed>',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '19.0.3.1',
  'overwrite.cli.url' => '<removed>',
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '<removed>',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'overwriteprotocol' => 'https',
  'mail_from_address' => 'nextcloud',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => '<removed>',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => '<removed>',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpname' => '<removed>',
  'mail_smtppassword' => '<removed>',
  'mail_smtpport' => '465',
);

```

---

<div class="post-metadata">

**Author:** ![Mugnier102](https://help.nextcloud.com/letter_avatar/mugnier102/32/5_5575768a8748004e209b776fc1b2916d.png) [@Mugnier102](https://help.nextcloud.com/u/Mugnier102)\
**Post date:** [February 28, 2021, 10:33pm UTC](https://help.nextcloud.com/t/cant-start-nextcloud-because-the-version-of-the-data-is-higher-than-the-docker-image-version-and-downgrading-is-not-supported/109438/2 "2021-02-28T22:33:52Z")

</div>

Find a solution for me (same but from version 18): just delete www folder before starting docker.

---

<div class="post-metadata">

**Author:** ![reibuehl](https://help.nextcloud.com/letter_avatar/reibuehl/32/5_5575768a8748004e209b776fc1b2916d.png) [@reibuehl](https://help.nextcloud.com/u/reibuehl)\
**Post date:** [March 1, 2021, 7:42am UTC](https://help.nextcloud.com/t/cant-start-nextcloud-because-the-version-of-the-data-is-higher-than-the-docker-image-version-and-downgrading-is-not-supported/109438/3 "2021-03-01T07:42:09Z")

</div>

I checked my whole docker volume but couldn’t find a folder named www anywhere.

---

<div class="post-metadata">

**Author:** ![reibuehl](https://help.nextcloud.com/letter_avatar/reibuehl/32/5_5575768a8748004e209b776fc1b2916d.png) [@reibuehl](https://help.nextcloud.com/u/reibuehl)\
**Post date:** [March 1, 2021, 12:27pm UTC](https://help.nextcloud.com/t/cant-start-nextcloud-because-the-version-of-the-data-is-higher-than-the-docker-image-version-and-downgrading-is-not-supported/109438/4 "2021-03-01T12:27:06Z")

</div>

I managed to get it fixed by restoring /version.php from backup into the container version 19 and then running a manual update via `docker-compose exec --user www-data nextcloud php occ -vvv upgrade` and then `docker-compose exec --user www-data nextcloud php occ maintenance:mode --off`.  
That got me back to a running v19.  
From there I could then pull the v20 docker image and run the upgrade to v20 using the same two commands.

---

<div class="post-metadata">

**Author:** ![MetroMarv](https://help.nextcloud.com/letter_avatar/metromarv/32/5_5575768a8748004e209b776fc1b2916d.png) [@MetroMarv](https://help.nextcloud.com/u/MetroMarv)\
**Post date:** [February 8, 2022, 5:45pm UTC](https://help.nextcloud.com/t/cant-start-nextcloud-because-the-version-of-the-data-is-higher-than-the-docker-image-version-and-downgrading-is-not-supported/109438/5 "2022-02-08T17:45:29Z")

</div>

Hey @reibuehl, I’m stuck in a similar situation than you (upgraded accidentally to version 22 from version 20).

Could you explain your fix in more detail?

As I understood you started the old image (version 19 in your case) and restored some `version.php` file from a backup. But which `version.php` file was that? The one from version 19? Because that leads to the `Can't start Nextcloud because the version of the data is higher than the docker image version` error in my case.

---

<div class="post-metadata">

**Author:** ![dotmpe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/dotmpe/32/46234_2.png) [@dotmpe](https://help.nextcloud.com/u/dotmpe)\
**Post date:** [September 30, 2022, 12:19pm UTC](https://help.nextcloud.com/t/cant-start-nextcloud-because-the-version-of-the-data-is-higher-than-the-docker-image-version-and-downgrading-is-not-supported/109438/6 "2022-09-30T12:19:08Z")

</div>

If any one is still finding this, the issue is not in config but in html/version.php

---

<div class="post-metadata">

**Author:** ![Ryan\_Allen](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ryan_allen/32/62729_2.png) [@Ryan\_Allen](https://help.nextcloud.com/u/Ryan_Allen)\
**Post date:** [June 22, 2024, 5:55am UTC](https://help.nextcloud.com/t/cant-start-nextcloud-because-the-version-of-the-data-is-higher-than-the-docker-image-version-and-downgrading-is-not-supported/109438/7 "2024-06-22T05:55:54Z")

</div>

This solution is missing some important details.

I’m in this same situation, but accidently tried to update from 22.0.12 to 24.0.12. Now when I go back to 22, or 23, I get the error that my data is at 24.0.12 and cannot downgrade. And when I try to run 24.0.12, I am told I cannot upgrade from 22 to 24.

Can somebody please detail exactly what it takes to get back to 22 or upgrade to 23, so I can upgrade to 24?

Something with the version.php file, I understand. But the specifics of exactly what to do with that file are vague.

---

<div class="post-metadata">

**Author:** ![Ryan\_Allen](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ryan_allen/32/62729_2.png) [@Ryan\_Allen](https://help.nextcloud.com/u/Ryan_Allen)\
**Post date:** [June 22, 2024, 6:39am UTC](https://help.nextcloud.com/t/cant-start-nextcloud-because-the-version-of-the-data-is-higher-than-the-docker-image-version-and-downgrading-is-not-supported/109438/8 "2024-06-22T06:39:09Z")

</div>

I got it to work by editing version.php. In my case, I started with v22 and then tried to update to 24. I was caught in the same situation.

Set:  
$OC\_Version  
$OC\_VersionString

To the STARTING version (22 in my case).

Then I added the starting version to this variable (so it had three versions in the string, (22, 23, 24):

$OC\_VersionCanBeUpgradedFrom = array (  
‘nextcloud’ =\>  
array (  
‘22.2’ =\> true,  
‘23.0’ =\> true,  
),

Then I updated the container image to the incremental major version (23). The upgrade from 22 to 23 worked flawlessly.

Then I upgraded from 23 to 24, and so on.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [June 22, 2024, 7:32am UTC](https://help.nextcloud.com/t/cant-start-nextcloud-because-the-version-of-the-data-is-higher-than-the-docker-image-version-and-downgrading-is-not-supported/109438/9 "2024-06-22T07:32:32Z")

</div>


