How to upgrade to nextcloud 18.0.1

Upgrade nextcloud 17.x.x to 18.0.1 from the terminal when the rest fails.

I’m assuming you have nextcloud in /var/www/nextcloud it may also be found in /var/www/html/nextcloud

sudo su

mkdir /var/www/nextcloudold

mv /var/www/nextcloud/* /var/www/nextcloudold/

cd /tmp



cp -r nextcloud/* /var/www/nextcloud/

cp /var/www/nextcloudold/config/config.php /var/www/nextcloud/config/

NOTE: If your data folder is in the nextcloud folder, you must move it with this step, if you have it outside the nextcloud folder (which is best) you do not need to move it and skip this line:
mv /var/www/nextcloudold/data /var/www/nextcloud/data

cd /var/www/nextcloud/

sudo -u web1 php occ upgrade

rm -r /var/www/nextcloudold

sudo -u web1 php occ db:add-missing-indices

What actually is your error? There are just a bunch of commands…