You didn’t provide any information. If you’re expecting help, don’t be stingy with it.
I don’t know what hardware your server runs on, whether you have it at home yourself, because then you should take the opportunity and upgrade to the next LTS release (22.04) right away.
Which apt-sources are used for php?
Informations about the web server used (apache2, nginx)would be fine as well.
Did you once install everything yourself?
You can use the script php-updater if you do not want to upgrade your server to Ubuntu 22.04 and if you don’t know the apt-sources of your php.
Install the script with these commands:
sudo wget -qO /usr/local/bin/php-updater https://global-social.net/script/php-updater
sudo chmod +x /usr/local/bin/php-updater
run it with
sudo php-updater
choose 8.1 as php version
If the script abborts with this message:
‘php8.1’ seems not to be available in your apt-sources
Did you enter a valid version string of an existing php, like ‘8.1’?
Or maybe you need a :ppa or :dpa for your desired php version
You need to solve that first, exiting
then you should run this commands:
sudo add-apt-repository ppa:ondrej/php
sudo apt update
then run sudo php-updater
again.
It will guide you through the update process and helps you to migrate all settings from php7.4 to your new php version. Simply allways choose the provided answer (Y or N)
With this command:
for linkgroup in $(ls /var/lib/dpkg/alternatives/ | grep -E "ph(ar|p)"); do sudo update-alternatives --config $linkgroup; done
you can switch from php-version by choosing manual to the desired version instead of auto (to the highest installed) for all php related packages with version alternatives.
Restart your webserver (I still don’t know what server you are on, I assume apache2):
sudo systemctl restart apache2
and look if everything runs fine.
Now it is time to at least make a dump of your database like described here: https://docs.nextcloud.com/server/25/admin_manual/maintenance/backup.html#backup-database
With that dump you have the posibility to restore your nextcloud in your now (24.03) state. The backup from your files is done by the updater:
sudo -u www-data -f /var/www/nextcloud/updater/updater.phar
follow the steps until the end.
Then you should run these occ commands:
occ db:add-missing-columns
occ db:add-missing-indices
No guarrantee
Much luck.