Upgrade from 25.0.13 / PHP version differences / upgrade path

Hello,

I have Nextcloud version 25.0.13 running on Ubuntu 20.04 LTS with PHP 7.4.3.

As far as I know, these systems are too old to get updated via the web app. I tried to copy the installation to an Ubuntu 24.04 instance, but here it says that PHP is too young:

This version of Nextcloud is not compatible with PHP>=8.2.
You are currently running 8.3.6.

Any ideas how I can move the current instance to the new server and/or update to a newer Nextcloud version?

Thanks!

I have the exact same issue.
I’ll update if I find a solution.
I already tried dist upgrade to 22 LTS and then manually upgrade nextcloud to latest and that failed so I restored from backup and will try something else this weekend.
-Muddy

First of all:
Please find the table, where Nextcloud versions and their corresponding PHP versions are listed:

I used the following guides to upgrade PHP as well as downgrading from PHP 8.3 to 8.1:

(in German)

I had the same idea, going to 22.04 and the to 24.04, but that also failed with a number of curious errors.

I have now decided to do a fresh installation and copy over the settings and contents. As I have not activated many extensions and not many users are there, I hope that it will not end up in too much manual work :slight_smile:
Cheers,

Tom

Thanks a lot! i tried out already some of the things mentined in the thread, but ran into many new problems. So I will try to start with a clean installation and try to copy over settings & content.

You should stay on the new Ubuntu and install php7.4, then update from major version to major version.

You should use → the php-updater script ← to install the normaly not shipped php versions.

The Script will add the required apt sources to obtain php 7.4.
After you have done that, you can install exactly the same modules on the new server as you had on the old server.

This will give you a list of those packages on the old server:

dpkg -l|awk '/^[hiu]i\s+[^\s]*php/{print$2}'

Then you can copy all the php.ini files into the new server. The php updater script can migrate those old settings to the new php versions.


Much and good luck,
ernolf

1 Like

Thanks ernolf, but its not an option on the current server to change the PHP version.

I think my current plan to install a brand new instance on the new server and then copy over the content should be the best one. I have just a few users, few hudreds GB data (which needs to be copied over anyway), some shares and some calendars. The “share” table seems to be the same and the calendars can be exported/imported.

I got it to work. Upgraded to
Version
Nextcloud Hub 4 (26.0.13)
on “Ubuntu 20.04.6 LTS” (from php7.4 to 8.2)

Also see the ability in the gui to upgrade to 27 next

Following guides:
(Upgrade php to 8.2 since 26 and 27 both use it.)

  1. Make sure to remove ALL 7.4 php modules and install the same extensions for 8.2 you had for 7.4 so the upgrade succeeds.
    https://computingforgeeks.com/how-to-install-php-on-ubuntu-linux-system/
    (tried ernolf’s tool but it just kept looping and to save time used the other method)

  2. Follow the normal manual upgrade guide
    After stopping web server do the full php remove/install process
    I had to reboot the server after the upgrade for it to start working.
    Upgrade manually — Nextcloud latest Administration Manual latest documentation

I did write a simple one liner to sync over my apps since they were not all the defaults. I’ll leave here if it helps. Run from the /var/www directory if you have nextcloud.backup as your original data directory during the upgrade. Change names, paths as needed.

for DIR in $(ls -1 nextcloud.old/apps/);do echo "$DIR";if [[ $(ls -1 nextcloud/apps/"$DIR" 2>/dev/null) ]];then echo FOUND;else echo MISSING;rsync -av --progress nextcloud.old/apps/"$DIR" nextcloud/apps/;fi;done

After finally getting to 26 was able to upgrade using the normal administration gui to upgrade to 27.