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.

4 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