lab icon indicating copy to clipboard operation
lab copied to clipboard

[nextcloud] manually upgrade from PHP 7.3

Open noave opened this issue 2 years ago • 4 comments

On Uberspace we recently removed the outdated PHP version 7.3 which caused trouble for not updated Nextcloud versions below NC21. Because the automatic updater wont work without PHP 7.4 these steps show how to manually update your Nextcloud:

  1. Login to your shell https://lab.uberspace.de/howto_ssh/
  2. Rename your current nextcloud folder (your path may differ here, assuming /var/www/virtual/$USER/html for now ) mv /var/www/virtual/$USER/html /var/www/virtual/$USER/html.old
  3. Recreate your nextcloud folder mkdir /var/www/virtual/$USER/html
  4. Go to this folder and download the following Nextcloud major version to yours, so if you are on NC20 then NC21: cd /var/www/virtual/$USER/html curl https://download.nextcloud.com/server/releases/nextcloud-21.0.0.tar.bz2 | tar -xjf - --strip-components=1
  5. Copy your old config file here cp /var/www/virtual/$USER/html.old/config/config.php /var/www/virtual/$USER/html/config/
  6. Check if your file data storage is inside the old nextcloud folder grep datadirectory /var/www/virtual/$USER/html/config/config.php if so, copy or better move it as well
  7. Run the upgrade command php occ upgrade

From Nextcloud Version 21 on, the update script will work again with the current PHP versions (PHP 7.4 and higher). If you are on very outdated Nextcloud versions like NC18, you will have to do the manual upgrade described here for each version until NC21, so NC18->NC19->NC20->NC21

noave avatar Jun 14 '22 12:06 noave

~~I think since you've already moved that directory (at 6.) it should look like this:~~ edit: removed misleading information

  • Do you think these manual steps should make their way back to the guide? - Maybe at the troubleshooting section?
  • Perhaps we could add one more note: Nextcloud major releases are planned to be actively maintained for at least 8 months after their release, in reality it looks like about 1 year at maximum, see Maintenance-and-Release-Schedule. Staying productive with older releases to ensure the compatability to apps and costum adjustments is totally fine as long as you don't exceed the end of life.

EV21 avatar Jun 15 '22 11:06 EV21

I think since you've already moved that directory (at 6.) it should look like this:

its only copied in 5, so it does'nt matter :-)

Do you think these manual steps should make their way back to the guide? - Maybe at the troubleshooting section?

no, this is just a little service guide to link people here from our support which is, so we hope, a temporary problem because the switch from php7.3 to php7.4 broke the possiblity to use the automatic updater. Which is just a problem for users who did not update their NCs for longer time (aka never). We are going to tweak the version deprecation process in the future, so that problems like this turn up earlier before we have to remove the outdated versions completely and users have the possibility to switch back to recently outdated programming versions.

Staying productive with older releases to ensure the compatability to apps and costum adjustments is totally fine as long as you don't exceed the end of life.

I guess its more the problem, that users do not keep old versions intentionally but just because they never tried to do updates :-) Or there were problems using the GUI updater. In never versions of the nextcloud guide we advise them to use a script which should do the work.

noave avatar Jun 15 '22 12:06 noave

its only copied in 5, so it does'nt matter :-)

my mistake 😞, I ignored 5. and only focused on 2. and 6. - In my thinking the cp/mv part would be done after that.

Staying productive with older releases to ensure the compatability to apps and costum adjustments is totally fine as long as you don't exceed the end of life.

I guess its more the problem, that users do not keep old versions intentionally but just because they never tried to do updates :-) Or there were problems using the GUI updater. In newer versions of the nextcloud guide we advise them to use a script which should do the work.

Indeed I also had many problems with the web based updater. I think since (I guess) NC16 or so I only use the script (triggered by cron) and it only had one hickup with the upgrade to NC21.

In the past the major updates got delayed a few weeks but since a few major releases I always got the vX.0.0 update at the release date. I'm not always happy with that so I wrote another script (it does the manual update) for the point releases (aka production/enterprise release channel).

EV21 avatar Jun 15 '22 14:06 EV21

Some users have problems with Nextcloud which are older than NC18 because the manual update guide here wont work with them. In this case its probably necessary to migrate the Code/DB externally on a system with PHP 7.3 or to install NC new and import the files. Maybe someone else here has better solutions or can write guides for these cases.

Discussion here is open for users who have these problems and users who might be able to help :-)

noave avatar Jun 20 '22 12:06 noave