Upgrade from v25 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).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 25.0.4
  • Operating system and version (e.g., Ubuntu 24.04):
    • Debian 11
  • Web server and version (e.g, Apache 2.4.25):
    • Apache/2.4.54 (Debian)
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • n/a
  • PHP version (e.g, 8.3):
    • PHP 8.1.16
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • n/a
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Docker
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

I currently have an v25.0.4 instance which I want to upgrade to the latest version (v32.x.x). The installation is based on Docker containers with the Nextcloud app image being retrieved from ā€œimage: nextcloud:latestā€.

I’d like to upgrade the app to the latest version (v32.x.x). I know I will have to go through the entire list v25 –> v26 –> v27… –> v32, but how will I practically upgrade one version at a time? Just changing the name of the image (nextcloud:26 maybe) in the compose file, stopping / restarting the container? Should I also upgrade the database (currently mariadb:10.5)?

Can you please indicate the syntax for the name too?

Thanks in advance for any help!

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

<?php
$CONFIG = array (
  'default_phone_region' => 'BE',
  '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' => 'instanceID',
  'passwordsalt' => 'SALT',
  'secret' => 'SECRET',
  'trusted_domains' => 
  array (
    0 => 'domain.com',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '25.0.4.1',
  'overwrite.cli.url' => 'https://domain.com',
  'overwriteprotocol' => 'https',
  'dbname' => 'nextcloud',
  'dbhost' => 'mariadb',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nc-user',
  'dbpassword' => 'DBPASSWORD',
  'installed' => true,
  'mail_from_address' => 'nextcloud',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'domain.com',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.host.org',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'postmaster@domain.com',
  'mail_smtppassword' => 'SMTPPASSWORD',
  'allow_local_remote_servers' => true,
  'app_install_overwrite' => 
  array (
    0 => 'groupfolders',
  ),
  'maintenance' => false,
  'log_rotate_size' => 5242880,
  'loglevel' => 0,
  'theme' => '',
);

Apps

The output of occ app:list (if possible).

Talk + OnlyOffice

Since you use Debian 11 and the EOL of Debian 11 will be end of August 2026 you shall think about a fresh new install With Debian 13 instead of the long update odyssey from 25 to 32. And your 25 is EOL since two years. Therefore, the system must potentially be considered compromised due to missing updates from October 2023 til now.

Same with PHP.

If you want to upgrade your current system, you also will need to upgrade PHP to the latest supported version of your current Nextcloud version. - That is a lot of work, because you cannot skip all versions. - Otherwise it might take you a few days to do that.

The beast way ist to setup a completely new system and the migrate from old to new one.

I think you can better make a new installation. You can use the old data files with a occ files scan.

Yes, but that will happen again in a few years if they don’t update.

@jlgarnier A manual Nextcloud installation requires a lot of maintenance. If you want to keep maintenance work to a minimum and only require basic features such as file storage and calendars and contacts, Ubuntu + Nextcloud Snap would be a better choice. If you want the full package with all the bells and whistles, Nextcloud AIO would be a better choice. However, you still need to take care of and keep the OS and/or Docker up to date. Maintenance is simply part of hosting your own server.

1 Like

Why is everyone here so concerned with still-LTS-supported-for-another-8-months debian versions and php version upgrades ?

He said the instance is docker-based, so he does not have to worry about either of these.
The php version will get updated with the docker to the exact correct version and upgrading debian will not be a big deal, because that does not touch the dependencies running in the docker at all, as long as dockerd still works after the upgrade his docker containers will continue to work like they did before.

Pretty much. Change the nextcloud docker version (replace ā€œlatestā€ with the next major version number after your current one (you can get a list of available image tags here, you’ll likely want version tags like this, because you want the latest patch release for every major release) in the compose file and run ā€œdocker compose up -dā€ (docker compose restart is not enough). Increment until you reach at least 31 or better 32. Test the instance after each step.

You can get the supported versions of mariadb for every version of nextcloud here: System requirements — Nextcloud latest Administration Manual latest documentation
(replace the 32 in the url with the NC version you are interested in)
Yes you should try to keep the mariadb instance in the supported range for your nexcloud version, thankfully the supported range is quite large.

As I don’t use mariadb (in docker) myself I can’t tell you how to upgrade it, but this environment variable seems like it should help: mariadb - Official Image | Docker Hub , so probably enable that, increment the image version number and compose up, but better look up a proper tutorial on how to upgrade mariadb installed via docker compose.
AND MAKE SURE TO BACK UP YOUR DATABASE (using mariadb-dump) BEFORE YOU CHANGE ANYTHING. Best to make a database backup after each NC upgrade too.

5 Likes

I’m in a very similar situation and plan on a new installation. one question: What do you mean exactly with: ā€œYou can use the old data files with a occ files scanā€.

Thank you

If you administrate your Nextcloud by yourself, you should have heard about the ā€œadministration manualā€ and have read it:

Copy the files into the data folder and run occ files:scan from command line as described in the manual. :wink:

1 Like

Thank you very much indeed!

While searching, many things are lost. When asking, one can also learn.

Thanks again

BenBenna

Thanks adelaar, but it’s a customer’s choice : no maintenance contract, then suddenly pops up to get the latest release…

When you say ā€œa fresh new installā€, what about the existing data? How would I migrate it to the new instance?

Thanks a lot for your help!

Thanks @Mornsgrans , but what is the process for data migration over so many versions?

Thanks @bb77, but it’s a customer’s choice: no maintenance contract, so everything is now outdated. I plan to update the system and all dependencies, including PHP, but can’t switch to Ubuntu, AIO, or whatever. All I need is be able to update to the latest version of the whole stack (currently MariaDB 10.5, OnlyOffice, Clamav, Nextcloud 25).

Thanks a lot @TessyPowder! Looks like it’ll take a lot of time and I’ll come across multiple boring tasks but your answer gives hope the whole process will be successful! :wink: As I said, I don’t have the choice: customer came and say ā€œplease upgrade this instance to the latest versionā€.

By the way, what about automating the upgrade (i.e. with Watchtower or equivalent tool)? Is there any risk the whole chain breaks because additional upgrades are needed?

Hi all!

Thanks for all the information. I started the upgrade this morning and something went wrong:

  • Saved all data and config

  • Saved the database

  • Upgraded the stack in Portainer: Nextcloud 25.0.4 → 26.0.13, MariaDB 10.5 → 10.6. The upgraded ended successfully, all containers were up and running.

  • Checked that I can access the admin interface: login OK

  • Performed the complementary upgrade for the database, as read in the documentation: occ db:add-missing-columns, occ db:add-missing-indices, occ db:add-missing-primary-keys

  • Scan all files: occ files:scan --all

  • The application now displays ā€œInternal Server Error

    The server encountered an internal error and was unable to complete your request.
    Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
    More details can be found in the server log."

All containers are still up and running, but the DB log display ā€œ2026-01-26 12:59:31 0 [ERROR] Incorrect definition of table mysql.event: expected column ā€˜definer’ at position 3 to have type varchar(, found type char(141).

2026-01-26 12:59:31 0 [ERROR] mariadbd: Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.ā€ and I don’t know how to fix this…

I’m now stuck and can’t resume the upgrade. :worried:

Thanks in advance for any help!

This might happen, if several PHP-versions are installed. In That case the wrong PHP-version can be called. - Please try to add the path to the correct php in your call:

sudo -u www-data /path/to/php occ db:add-missing-columns

Thanks @Mornsgrans, but I can’t even find where PHP is located within the container, so I can’t check if there’s multiple versions installed.

I’m wondering if it’s worth the effort and think about installing a fresh instance of Nextcloud AIO, but:

  • I’ve found this compose file: all-in-one/compose.yaml at main Ā· nextcloud-releases/all-in-one Ā· GitHub and hope it will fit.
  • I have saved all files so restoring them back into the new instance wouldn’t be a big deal (copy them into the /data directory).
  • I need to restore all accounts (admins + users) and the associated privileges. I’ve saved the current database (Nextcloud v25) but don’t know how I could import it into Nextcloud AIO (which uses Postgresql). Any procedure for this?
  • I’d like to keep OnlyOffice as users are already used to this application and most of the documents have been created with OO.
  • I’d like to install ClamAV and plug it into AIO: hope it’s just a matter of configuration.

Thanks in advance for any help!

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.