Skip to content

Instantly share code, notes, and snippets.

@ikidd
Created January 17, 2020 06:02
Show Gist options
  • Save ikidd/6aa63aa4e4305f178e08c2de003098da to your computer and use it in GitHub Desktop.
Save ikidd/6aa63aa4e4305f178e08c2de003098da to your computer and use it in GitHub Desktop.
**Upgrade process**
DO NOT USE WEB-BASED UPGRADE!
- put into Maintenance Mode
`sudo -u http php /usr/share/nginx/nextcloud/occ maintenance:mode --on`
- stop and/or disable nginx, maybe reboot
`systemctl disable nginx.service`
- unmount nextcloud data folder:
`zfs unmount zstore1/nextcloud_data`
- rename /usr/share/nginx/nextcloud folder to nextcloud.old
`mv nextcloud nextcloud.old`
- download and unzip update into a new nextcloud folder in nginx webroot
`wget https://download.nextcloud.com/server/releases/nextcloud-15.0.tar.bz2`
`tar -xjvf nextcloud-15.0.tar.bz2`
- ensure you now have a nextcloud folder
- copy over config.php from old nextcloud to new nexcloud config folder
- copy over nextcloud/apps from old folder
`cd /usr/share/nginx/nextcloud/apps`
`cp -r . /usr/share/nginx/nextcloud.old/apps` #copies new apps to old folder for existing
`cd /usr/share/nginx/nextcloud.old/apps`
`cp -r . /usr/share/nginx/nextcloud/apps` #copies all back to apps folder
- Make a data folder under nexcloud for the data mount
`mkdir /usr/share/nginx/nextcloud/data`
- adjust permissions as per https://docs.nextcloud.com/server/13/admin_manual/maintenance/manual_upgrade.html (use http user instead of www-data user in docs)
`chown -R http:http nextcloud`
`find nextcloud/ -type d -exec chmod 750 {} \;`
`find nextcloud/ -type f -exec chmod 640 {} \;`
- remount data folder
`zfs mount zstore1/nextcloud_data`
- restart/enable nginx and run the upgrade:
`systemctl enable --now nginx.service`
`cd nextcloud`
`sudo -u http php occ upgrade`
- take out of Maintenance Mode
`sudo -u http php occ maintenance:mode --off`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment