{"id":1486,"date":"2018-12-01T14:43:25","date_gmt":"2018-12-01T11:43:25","guid":{"rendered":"http:\/\/kifarunix.com\/?p=1486"},"modified":"2022-02-15T21:18:11","modified_gmt":"2022-02-15T18:18:11","slug":"how-to-upgrade-owncloud-9-to-owncloud-10-on-ubuntu-16-04","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/how-to-upgrade-owncloud-9-to-owncloud-10-on-ubuntu-16-04\/","title":{"rendered":"How to Upgrade ownCloud 9 to ownCloud 10 on Ubuntu 16.04"},"content":{"rendered":"\n<p>Hello there, welcome to our guide on how to upgrade ownCloud 9 to ownCloud 10 on Ubuntu 16.04 . ownCloud 10 also <a href=\"https:\/\/owncloud.org\/news\/introducing-owncloud-x\/\" target=\"_blank\" rel=\"noopener noreferrer\">ownCloud X<\/a> is the lastest version.<\/p>\n\n\n\n<p>So you could be still running ownCloud server version 9 and whenever you want to synchronize your files with your upto-date ownCloud desktop client you get some version mismatch issues? Worry not because in this guide, we will show you on how to upgrade to the latest version of ownCloud so that you can continue enjoying the beauty of sharing you files and data over this amazing platform.<\/p>\n\n\n\n<p>The interface for ownCloud 9 looks like as shown below;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/kifarunix.com\/wp-content\/uploads\/2018\/12\/owncloud-9-interface.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1405\" height=\"661\" src=\"http:\/\/kifarunix.com\/wp-content\/uploads\/2018\/12\/owncloud-9-interface.png\" alt=\"owncloud-9-interface\" class=\"wp-image-1557\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2018\/12\/owncloud-9-interface.png 1405w, https:\/\/kifarunix.com\/wp-content\/uploads\/2018\/12\/owncloud-9-interface-768x361.png 768w\" sizes=\"(max-width: 1405px) 100vw, 1405px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"upgrade-owncloud-9-to-owncloud-10\">Upgrade ownCloud 9 to ownCloud 10<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"pre-requisites\">Pre-requisites<\/h3>\n\n\n\n<p>Well, before you can begin the upgrade process, ensure that you meet the following minimums;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The upgrade process involves putting the server in maintenance mood. Hence notify users on the same.<\/li><li>Make a backup of your ownCloud server&nbsp; <code><span class=\"pre\">data directory<\/span><\/code>, <code><span class=\"pre\">config.php<\/span><\/code>, <code><span class=\"pre\">3rd party apps<\/span><\/code> and <code><span class=\"pre\">ownCloud database<\/span><\/code>.<\/li><li>If any third party application is installed, review them for compatibility and disable them before upgrade. You can re-enable them after upgrade in case they are compatible.<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"update-the-server\">Update the server<\/h4>\n\n\n\n<p>Update and upgrade your server to ensure that other ownCloud mandatory requirements are updated.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update &amp;&amp; apt upgrade -y<\/code><\/pre>\n\n\n\n<p>There are three ways in which ownCloud server can be upgraded;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Manually upgrade method using the latest release ownCloud source code. This is the <strong>recommended<\/strong> method.<\/li><li>Using OS specific distribution package manager in conjunction with official ownCloud repositories.<\/li><li>Using Updater App in the case where admins have no command line access to the server.<\/li><\/ul>\n\n\n\n<p>In this guide, we are going to learn how to upgrade ownCloud using, of course, the recommended method, <strong>manual upgrade<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"manual-owncloud-upgrade\">Manual ownCloud Upgrade<\/h4>\n\n\n\n<p>As mentioned above, make the necessary backups as shown below;<\/p>\n\n\n\n<p>Backup ownCloud server directory;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>rsync -avpP \/var\/www\/owncloud \/opt\/backups\/<\/code><\/pre>\n\n\n\n<p>This ensures that a copy is made with permissions preserved.<\/p>\n\n\n\n<p>Backup the ownCloud database;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysqldump -u root -p owncloud &gt; \/home\/amos\/owncloud-`date +%F`.sql<\/code><\/pre>\n\n\n\n<p>Now, if you check you home folder;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ls -l \/home\/amos\/\ntotal 68\ndrwxr-xr-x 17 amos amos  4096 Nov 30 17:09 owncloud\n-rw-r--r--  1 amos amos 63216 Dec  1 11:19 owncloud-2018-12-01.sql<\/code><\/pre>\n\n\n\n<p><strong>NOTE<\/strong>: You can as well take a <strong>snapshot<\/strong> of the current state of your server so that you can always restore to it in case things go south. Nothing outdo a snap of the finger restore!!<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"enable-owncloud-maintenance-mode\">Enable ownCloud Maintenance Mode<\/h4>\n\n\n\n<p>Before you can proceed, put ownCloud on maintenance mode. This prevents new logins and locks the sessions of the logged in users. ownCloud will also display the status on the web UI to let users know what is happening.<\/p>\n\n\n\n<p>To enable maintenance mode, you can edit the <code><span class=\"pre\">\/var\/www\/owncloud\/config\/config.php<\/span><\/code> and change the value of <code><span class=\"pre\">'maintenance'<\/span> <span class=\"pre\">=&gt;<\/span><\/code><code><span class=\"pre\">false,<\/span><\/code> to <code><span class=\"pre\">'maintenance'<\/span> <span class=\"pre\">=&gt;<\/span> <span class=\"pre\">true,<\/span><\/code>. This can also be simply done by the use of <code><span class=\"pre\">occ command<\/span><\/code> as shown below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo -u www-data php \/var\/www\/owncloud\/occ maintenance:mode --on<\/code><\/pre>\n\n\n\n<p>Now, if you try to access ownCloud, you will see a status informing you of the state.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/kifarunix.com\/wp-content\/uploads\/2018\/12\/owncloud-maintenance-mode.png\"><img loading=\"lazy\" decoding=\"async\" width=\"825\" height=\"643\" src=\"http:\/\/kifarunix.com\/wp-content\/uploads\/2018\/12\/owncloud-maintenance-mode.png\" alt=\"owncloud-maintenance-mode\" class=\"wp-image-1559\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2018\/12\/owncloud-maintenance-mode.png 825w, https:\/\/kifarunix.com\/wp-content\/uploads\/2018\/12\/owncloud-maintenance-mode-768x599.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/a><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"stop-cron-jobs\">Stop Cron Jobs<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl stop cron<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"stop-the-web-server\">Stop the Web Server<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl stop apache2<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"download-the-latest-owncloud-server-release\">Download the Latest ownCloud Server Release<\/h4>\n\n\n\n<p>Navigate to<a href=\"https:\/\/owncloud.org\/download\/\" target=\"_blank\" rel=\"noopener noreferrer\"> ownCloud download page<\/a> and obtain the latest release&nbsp; source archive. Once you obtain the source archive link, you can simply download it as follows;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget https:\/\/download.owncloud.org\/community\/owncloud-10.0.10.tar.bz2 -P \/tmp\/<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"prepare-owncloud-for-upgrade\">Prepare ownCloud for Upgrade<\/h4>\n\n\n\n<p>Once the download is done, rename the original ownCloud folder an extract the new source archive to ownCloud web root directory, <code><span class=\"pre\">\/var\/www\/<\/span><\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mv \/var\/www\/owncloud \/var\/www\/owncloud-bak\ntar xjf \/tmp\/owncloud-10.0.10.tar.bz2 -C \/var\/www\/<\/code><\/pre>\n\n\n\n<p>Copy the old ownCloud data directory to the new source directory.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>rsync -avpP \/var\/www\/owncloud-bak\/data \/var\/www\/owncloud\/<\/code><\/pre>\n\n\n\n<p>Replace the new config.php file with the old one;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>rsync -avpP \/var\/www\/owncloud-bak\/config \/var\/www\/owncloud\/<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"upgrade-owncloud\">Upgrade ownCloud<\/h4>\n\n\n\n<p>Once you have&nbsp; your old data in place, run the command below to upgrade ownCloud.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo -u www-data php \/var\/www\/owncloud\/occ upgrade<\/code><\/pre>\n\n\n\n<p>Once the upgrade is done, you can verify the version of ownCloud by running the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo -u www-data php \/var\/www\/owncloud\/occ -V\nownCloud is in maintenance mode - no app have been loaded\n\n<strong>ownCloud 10.0.10<\/strong><\/code><\/pre>\n\n\n\n<p>If you had any old Apps, you can now copy them to the new Apps directory.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"upgrade-php-to-php-7-2\">Upgrade PHP to PHP 7.2<\/h4>\n\n\n\n<p>ownCloud recommends the use of PHP 7.2 in new installations. Note that there are no official PHP 7.2 repositories on Ubuntu 16.04. Thanks to Ond\u0159ej Sur\u00fd&#8217;s&nbsp; <a href=\"https:\/\/launchpad.net\/~ondrej\/+archive\/ubuntu\/php\" target=\"_blank\" rel=\"noopener noreferrer\">PHP PPA<\/a> repositories. Therefore, add the PPA respos and make the necessary updates.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>add-apt-repository ppa:ondrej\/php\napt update<\/code><\/pre>\n\n\n\n<p>You can optionally remove PHP 7.0 and install php7.2<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt remove php7.0*\napt autoremove\napt install php7.2 libapache2-mod-php7.2 php7.2-common php7.2-curl php7.2-gd php7.2-intl\\\n php7.2-json php7.2-ldap php7.2-mbstring php7.2-mysql php7.2-xml php7.2-zip php7.2-bz2<\/code><\/pre>\n\n\n\n<p>Verify the version.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>php -v\nPHP 7.2.12-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Nov 12 2018 09:55:12) ( NTS )\nCopyright (c) 1997-2018 The PHP Group\nZend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies\n    with Zend OPcache v7.2.12-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"disable-maintenance-mode\">Disable Maintenance Mode<\/h4>\n\n\n\n<p>If the upgrade is successful, disable maintenance mode by running the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo -u www-data php \/var\/www\/owncloud\/occ maintenance:mode --off<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"restart-the-webserver\">Restart the Webserver<\/h4>\n\n\n\n<p>Start your cron job service and the web server<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl restart cron\nsystemctl restart apache2<\/code><\/pre>\n\n\n\n<p>You can now login to your new ownCloud server. You should be welcomed by a new ownCloud X web interface.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/kifarunix.com\/wp-content\/uploads\/2018\/12\/owncloud-10.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1213\" height=\"651\" src=\"http:\/\/kifarunix.com\/wp-content\/uploads\/2018\/12\/owncloud-10.png\" alt=\"owncloud-10\" class=\"wp-image-1560\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2018\/12\/owncloud-10.png 1213w, https:\/\/kifarunix.com\/wp-content\/uploads\/2018\/12\/owncloud-10-768x412.png 768w\" sizes=\"(max-width: 1213px) 100vw, 1213px\" \/><\/a><\/figure>\n\n\n\n<p>You have successfully upgraded ownCloud 9 to ownCloud X on Ubuntu 16.04. You can now login and verify that every other previous setting is fine. Thank you for reading.<\/p>\n\n\n\n<p>Other similar tutorials<\/p>\n\n\n\n<p><a title=\"Install ownCloud Desktop Client on CentOS 8\" href=\"https:\/\/kifarunix.com\/install-owncloud-desktop-client-on-centos-8\/\" target=\"_blank\" rel=\"bookmark noopener noreferrer\">Install ownCloud Desktop Client on CentOS 8<\/a><\/p>\n\n\n\n<p><a title=\"Install ownCloud Desktop Client on Debian 10 Buster\" href=\"https:\/\/kifarunix.com\/install-owncloud-desktop-client-on-debian-10-buster\/\" target=\"_blank\" rel=\"bookmark noopener noreferrer\">Install ownCloud Desktop Client on Debian 10 Buster<\/a><\/p>\n\n\n\n<p><a title=\"Install ownCloud Server on CentOS 8\" href=\"https:\/\/kifarunix.com\/install-owncloud-server-on-centos-8\/\" target=\"_blank\" rel=\"bookmark noopener noreferrer\">Install ownCloud Server on CentOS 8<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello there, welcome to our guide on how to upgrade ownCloud 9 to ownCloud 10 on Ubuntu 16.04 . ownCloud 10 also ownCloud X is<\/p>\n","protected":false},"author":1,"featured_media":11059,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,249,39],"tags":[267,1245,1244],"class_list":["post-1486","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","category-owncloud","category-storage","tag-owncloud","tag-owncloud-10","tag-upgrade-owncloud-9-to-10","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/1486"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=1486"}],"version-history":[{"count":8,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/1486\/revisions"}],"predecessor-version":[{"id":11591,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/1486\/revisions\/11591"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/11059"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=1486"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=1486"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=1486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}