pan
June 14, 2016, 7:47pm
1
Hi,
I was wondering what the recommended installation method is/will be.
Previously the tar/zip method wasn’t great at providing upgrades.
Will there be packages for distros or will the self upgrade be better
supported and automated? Or is some completely different system
preferred?
Looking forward to install Nextcloud!
I have the same question as you. I have now ownCloud installation with special package setting for retrieving the last updates, see https://download.owncloud.org/download/repositories/stable/owncloud/
Thats works great for me.
Hi,
I was too with owncloud repos and “*.deb” packages and i migrated to Nextcloud manually ( tar/zip) without any problems. It’s the preferred method. Anyway, there’s no deb repos actually, and it’s very well like that…
Packaging distros has always been a mess with owncloud.
P.S. Follow the docs, and don’t forget to adjust your directories permissions
1 Like
Rello
June 14, 2016, 9:20pm
4
What is the problem with the zip? I have a small bash which works since OC6
wget zip
backup config.php & DB & theme folder
rm old OC folder
unzip OC
copy config.php & theme back
run OCC command
Thats it.
Never any issue
1 Like
oparoz
June 15, 2016, 12:25am
5
The easiest way on Linux, if you’re not interested in tuning your config too much is described here:
What you get
An officially supported installation of Nextcloud delivered via a Snap, a clever technology allowing users to always have the latest version of an “app”. It works on a large range of hardware, from powerful enterprise POWER8 servers down to the Raspberry Pi 2.
The current version is considered beta and is quite restrictive. It is not yet aimed at developers or advanced users who would want to tune their configuration by installing extra features. It is aimed at end-users who want …
1 Like
We also used the https://download.owncloud.org/download/repositories/stable/owncloud/ i cannot find the correct paths for Nextcloud yet? i prefer this way cause we can update our own/nextCloud systems trough YUM…
downloading a zip, unpacking and making the correct rights on folders is fun when you have 1 server, but we have over 10+ owncloud installations, YUM is the way to go.
Can you post your script here? I am curious…
could you give me that script?
thanks! i will make a dev of our live server to test
tflidd
June 16, 2016, 8:59am
11
Or do it like round cube. They have a little script in their archive that you can run:
installto.sh /path/to/nextcloud
Rello
June 16, 2016, 11:37am
12
wwpath=’/var/www’
ocpath=’/var/www/owncloud’
ocdata=’/var/owncloud’
htuser=‘www-data’
echo “start OC update”
cd ${ocpath}
sudo -u www-data php occ -V
read -p "Welche Zielversion? z.B. 8.0.7: " DLVERSION
sudo -u www-data php occ maintenance:mode --on
sudo -u www-data php occ app:disable contacts
sudo -u www-data php occ app:disable calendar
cd ${wwpath}
sudo rm -rf ${wwpath}/owncloud-backup
sudo mkdir ${wwpath}/owncloud-backup
sudo chmod 777 ${wwpath}/owncloud-backup/
sudo cp ${ocpath}/config/config.php ${wwpath}/owncloud-backup/
sudo cp -R ${ocpath}/themes/ ${wwpath}/owncloud-backup/
echo “files copied”
sudo mysqldump --opt --user=root --password=root --databases owncloud | gzip -c -9 > ${wwpath}/owncloud-backup/owncloud_DB.gz
echo “DB copied”
wget -O ${wwpath}/owncloud-latest.tar.bz2 http://download.owncloud.org/community/owncloud-${DLVERSION}.tar.bz2
sudo rm -rf ${wwpath}/owncloud
cd ${wwpath}
tar -xjvf owncloud-latest.tar.bz2
sudo cp ${wwpath}/owncloud-backup/config.php ${ocpath}/config/
sudo cp -R ${wwpath}/owncloud-backup/themes/ ${ocpath}/
sudo rm ${wwpath}/owncloud-latest.tar.bz2
sudo find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
sudo find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750
sudo chown -R root:${htuser} ${ocpath}/
sudo chown -R ${htuser}:${htuser} ${ocpath}/apps/
sudo chown -R ${htuser}:${htuser} ${ocpath}/config/
find ${ocdata}/ -type f -print0 | xargs -0 chmod 0640
find ${ocdata}/ -type d -print0 | xargs -0 chmod 0750
sudo chown -R ${htuser}:${htuser} ${ocdata}/
cd ${ocpath}
sudo -u www-data php occ upgrade
sudo -u www-data php occ maintenance:mode --off
sudo -u www-data php occ -V
2 Likes
Rello
June 16, 2016, 11:38am
13
store this in an OC_update.sh and you can use it every time
Thanks for your script! I have manually installed nextcloud on ubuntu 16.04 and having to upgrade manually each time is a bit of a hassle.
I have modified the script to suit my environment (Ubuntu 16.04, NGINX, MySQL/MariaDB, PHP7)
Tested and working!
#!/bin/bash
#Nextcoud upgrade script
set -e #stop on error
wwpath='/var/www'
ncpath='/var/www/nextcloud'
ncdata='/var/www/nextcloud/data'
datain=true #set false if you keep your data outside nextcloud
htuser='www-data'
htgroup='www-data'
rootuser='root'
echo "start NC update"
cd ${ncpath}
sudo -u www-data php occ -V
read -p "Which version to download? i.e. 10.0.2: " DLVERSION
#try download first before changing anything
echo "Downloading nextcloud ${DLVERSION}"
wget -O /tmp/nextcloud-latest.tar.bz2 https://download.nextcloud.com/server/releases/nextcloud-${DLVERSION}.tar.bz2
#Prepare nextcloud for maintenance
sudo -u www-data php occ maintenance:mode --on
sudo -u www-data php occ app:disable contacts
sudo -u www-data php occ app:disable calendar
#stop NGINX
sudo systemctl stop nginx
cd ${wwpath}
sudo mv ${ncpath} ${wwpath}/nextcloud-old
sudo chmod 777 ${wwpath}/nextcloud-old/
echo "files copied"
set +e #mkdir could throw an error if the directory already exists
sudo mkdir ${wwpath}/nextcloudDB-backup
set -e
sudo chmod 777 ${wwpath}/nextcloudDB-backup/
sudo mysqldump --lock-tables --opt --user=nextcloud --password='mypassword' --databases nextcloud | gzip -c -9 > ${wwpath}/nextcloudDB-backup/nextcloudDB.gz
echo "DB copied"
#Extract previously downloaded owncloud
echo "Extracting nextcloud ${DLVERSION}"
tar -xjvf /tmp/nextcloud-latest.tar.bz2
#Replace original config
set +e
sudo rm ${ncpath}/config/config.php
sudo rm -rf ${ncpath}/themes
sudo rm -rf ${ncpath}/data
set -e
sudo mv ${wwpath}/nextcloud-old/config/config.php ${ncpath}/config/
sudo mv ${wwpath}/nextcloud-old/themes/ ${ncpath}/
if [ "$datain" = true ]
then
sudo mv ${wwpath}/nextcloud-old/data/ ${ncpath}/
fi
#Set permissions
#Script from this page
#https://docs.nextcloud.com/server/9/admin_manual/installation/installation_wizard.html
printf "Creating possible missing Directories\n"
sudo mkdir -p $ncpath/data
sudo mkdir -p $ncpath/assets
sudo mkdir -p $ncpath/updater
printf "chmod Files and Directories\n"
sudo find ${ncpath}/ -type f -print0 | xargs -0 chmod 0640
sudo find ${ncpath}/ -type d -print0 | xargs -0 chmod 0750
printf "chown Directories\n"
sudo chown -R ${rootuser}:${htgroup} ${ncpath}/
sudo chown -R ${htuser}:${htgroup} ${ncpath}/apps/
sudo chown -R ${htuser}:${htgroup} ${ncpath}/assets/
sudo chown -R ${htuser}:${htgroup} ${ncpath}/config/
sudo chown -R ${htuser}:${htgroup} ${ncpath}/themes/
sudo chown -R ${htuser}:${htgroup} ${ncpath}/updater/
sudo find ${ncdata}/ -type f -print0 | xargs -0 chmod 0640
sudo find ${ncdata}/ -type d -print0 | xargs -0 chmod 0750
sudo chown -R ${htuser}:${htgroup} ${ncdata}/
chmod +x ${ncpath}/occ
printf "chmod/chown .htaccess\n"
if [ -f ${ncpath}/.htaccess ]
then
chmod 0644 ${ncpath}/.htaccess
chown ${rootuser}:${htgroup} ${ncpath}/.htaccess
fi
if [ -f ${ncdata}/.htaccess ]
then
chmod 0644 ${ncdata}/.htaccess
chown ${rootuser}:${htgroup} ${ncdata}/.htaccess
fi
#Start Nginx
sudo systemctl start nginx
#Run upgrade
echo 'occ upgrade in progress...'
cd ${ncpath}
sudo -u www-data php occ upgrade
sudo -u www-data php occ maintenance:mode --off
sudo -u www-data php occ -V
#Cleanup
echo 'cleaning up...'
cd ${wwpath}
sudo rm -rf ${wwpath}/nextcloudDB-backup
sudo rm /tmp/nextcloud-latest.tar.bz2
sudo rm -rf ${wwpath}/nextcloud-old
echo 'NC Upgrade completed successfully!'
As of 10.0.1 the auto-updater script is included, just so everyone’s aware
1 Like
Adding it to the docs would be great!
somewhere in this page How to Upgrade Your Nextcloud Server
Thanks
tflidd
October 18, 2016, 11:04am
17
Here is the document:
==============
How to upgrade
==============
There are three ways to upgrade your Nextcloud server:
* With the :doc:`Updater App <update>`.
* :doc:`Manually upgrading <manual_upgrade>` with the Nextcloud ``.tar`` archive
from our `Download page <https://nextcloud.com/install/>`_.
* :doc:`Upgrading <package_upgrade>` via the snap packages.
* Manually upgrading is also an option for users on shared hosting; download
and unpack the Nextcloud tarball to your PC. Delete your existing Nextcloud
files, except ``data/`` and ``config/`` files, on your hosting account. Then
transfer the new Nextcloud files to your hosting account, again
preserving your existing ``data/`` and ``config/`` files.
When an update is available for your Nextcloud server, you will see a
notification at the top of your Nextcloud Web interface. When you click the
notification it brings you here, to this page.
This file has been truncated. show original
You can clone this repo, make changes to this page and then create a pull request Or at least open an issue https://github.com/nextcloud/documentation/issues and make some suggestions what and how to change it.
1 Like
system
Closed
September 23, 2024, 6:24pm
18
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.