Upgrade from V21 to V32

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

I need to migrate a V21 instance (files, user info, etc.) of nextcloud to the lastest version (V32, i guess). I cannot upgrade the V2 instance step by step (ie. V21→V22, then V22–>V3, etc.).

The source instance is old (debian 9) and the target instance would be on a new machine (recent OS, recent PHP, recent MariagDb, etc.)

What could be the best process to achieve this migration ?

Thank you for your answsers,

F.

The Basics

  • Nextcloud Server version (e.g., 29.x.x):

    • 21.0.9
  • Operating system and version (e.g., Ubuntu 24.04):

    • Debian 9 Stretch
  • Web server and version (e.g, Apache 2.4.25):

    • 2.4.25
  • Reverse proxy and version _(e.g. nginx 1.27.2)

    • replace me
  • PHP version (e.g, 8.3):

    • php 7

But you will have to go that way. There is no alternative, among other things, because the database migration steps must be processed successively.

Look here for explanation. Quote:

Nextcloud must be upgraded step by step:

  • Before you can upgrade to the next major release, you need to upgrade to the latest point release of your current major version.
  • Then run the upgrade again to upgrade to the next major release’s latest point release.
  • You cannot skip major releases. Please re-run the upgrade until you have reached the highest available (or applicable) release.
  • Example: 18.0.5 → 18.0.11 → 19.0.5 → 20.0.2

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. To do so you should run the cron.php file 2-3 times, for example:

$ sudo -E -u www-data php -f /var/www/nextcloud/cron.php

You will need an “intermediate” debian (at least 11, bullseye, since 9, stretch, is obsolete since three years and 5 months already!)
In that intermediate debian, you can switch the php versions successively as supported by the different nextcloud versions.

You can do the php version switches with the php-updater ← script.

But you can start directly with debian 13 (trixie), the current stable and install php8.0 (a piece of cake with the php-updater script). Then you can simply do the complete migrations steps on the future actual system.


h.t.h.


ernolf

Please keep an eye on the needed PHP versions:

Upgrade to PHP 8.0 first, then you can keep this PHP version up to Nextcloud V29.
If Nextcloud V29 has been installed, you may upgrade to PHP 8.3.

After upgrading PHP you will need to remove the older PHP version and install additional needed PHP modules.

You can’t anymore update Debian 9, since also Debian 10 is EOL and the packages for Updates gone. You will need a fresh new install with Debian 13.
Since your System was running some years without updates it must be considered compromised by unwanted software, installed by bad guys from Russia or North Korea.

Thank you for your answers. Il will try to do it from a debian 13 with “old php”, step by step.

F.