»This version of Nextcloud is not compatible with > PHP 8.0.« using nextcloudpi

I had a running installation for about a year. The usb-stick with the file system broke. I made a new install of debian bullseye on a raspberry pi 4. Then I installed nextcloud using this one-stop-solution from here:


That worked, Nextcloud was running, I could log in as ncp (»:4443«).

Then I tried to restore my backup, but it doesn’t run, because obviously the installation of nextcloud via this install script brought php 8.1

Then I tried to change to version 22.2.10 of nextcloud, but nc-init threw many errors of PHP modules that were not installed. It ended:

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:162
Stack trace:
#0 /var/www/nextcloud/console.php(99): OC\Console\Application->loadCommands()
#1 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#2 {main}failed to get ID

OK, however, how can I restore nextcloud from my backups of obviously an older version of nextcloud?

I have no RPi to test. Also you have only supplied a setup script not how you run it.

I see many installation options but i would try this

export BRANCH="v1.45.0"; curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/v1.45.0/install.sh | bash

this should install nc 22.2.2 and php 7.4

as from GitHub - nextcloud/nextcloudpi at v1.45.0

if you clone first you should change the branch master to v.1.45.0

git clone -b v1.45.0 -single-branch https://github.com/nextcloud/nextcloudpi.git

as explained here.

then cd nextcloudpi

export CODE_DIR="nextcloudpi/"; sudo ./install.sh

edit. added export to make variable available system wide.

1 Like

Thank you very much, but unfortunately the install.sh script installs v. 24 of nextcloud, including php 8.1, regardless what I try. I cloned the git tag v1.45.0 and run the install.sh that came with it, but no avail. Restoring from my backup fails with

This version of Nextcloud is not compatible with > PHP 8.0.
You are currently running 8.1.12.Cleanup…

Any other ideas?

I downgraded php to v 8.0. This isn’t quite simple and includes things like update-alternatives, enable the new version for apache 2, install php 8.0 and all the modules which are needed by nextcloud.

Ok, then the :4443 window showed a running nextcloud, but I still got the error message when I tried to log in as user.

But then I simply upgraded the running nextcloud installation to the newest nextcloud version and voilà: works.