{"id":1208,"date":"2019-04-14T22:01:35","date_gmt":"2019-04-14T20:01:35","guid":{"rendered":"http:\/\/hobbykeller.spdns.de\/?p=1208"},"modified":"2019-05-16T14:32:20","modified_gmt":"2019-05-16T12:32:20","slug":"updating-nextcloud-via-updater-gui","status":"publish","type":"post","link":"https:\/\/hobbykeller.spdns.de\/?p=1208","title":{"rendered":"Updating Nextcloud via Updater GUI"},"content":{"rendered":"\r\n<p>While the updater GUI is really comfortable, I regularly run into difficulties with file permissions and timeouts. This post summarizes the steps needed to run an update via Nextclouds Update GUI successfully.<\/p>\r\n\r\n\r\n\r\n<p><!--more--><\/p>\r\n\r\n\r\n\r\n<h1 class=\"wp-block-heading\">1. Acquire su privileges and produce a fresh backup<\/h1>\r\n\r\n\r\n\r\n<p>This step contains preliminary work and the <a href=\"https:\/\/help.nextcloud.com\/t\/the-following-extra-files-have-been-found-assets\/21026\/7\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"removal of the assets (opens in a new tab)\">removal of the assets<\/a> directory which is normally empty but causes the Updater to stall immediately.<\/p>\r\n<pre class=\"lang:default decode:true \">sudo su\r\ncd \/var\/www\/\r\nrm -rf oldcloud\r\ncp -R owncloud oldcloud\/\r\nrm -rf owncloud\/assets<\/pre>\r\n<h1>2. Set ownership to www-data<\/h1>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<p>This step is needed to prevent the Nextcloud updater from failing the file and directory permissions check:<\/p>\r\n<pre class=\"lang:default decode:true  \">chown -R www-data:www-data owncloud\/<\/pre>\r\n<p>In case the check still fails, you can set file permissions as follows (takes a while to perform on my Pi ZeroW):<\/p>\r\n<pre class=\"lang:default decode:true\">find \/var\/www\/owncloud -type d -exec chmod 755 {} \\;\r\nfind \/var\/www\/owncloud -type f -exec chmod 644 {} \\;<\/pre>\r\n\r\n\r\n\r\n<h1>3. Increase timeout of Nginx<\/h1>\r\n\r\n\r\n\r\n<p>To prevent Nginx from running into a timeout during the creation of the backup, you have to edit <code>\/etc\/nginx\/nginx.conf<\/code>. Uncomment the <code>fastcgi_read_timeout<\/code> parameter and increase it from <code>600<\/code> to <code>6000<\/code>.<\/p>\r\n\r\n\r\n\r\n<p>Do not forget to reload the new configuration settings of Nginx by<\/p>\r\n<pre class=\"lang:default decode:true\">service nginx reload<\/pre>\r\n<p>In case, the update still fails, also try to uncomment and modify the parameter <code>proxy_read_timeout<\/code> in the same way as above.<\/p>\r\n\r\n\r\n\r\n<h1 class=\"wp-block-heading\">4. Start the updater web service<\/h1>\r\n\r\n\r\n\r\n<p>Log in as admin on your Nextcloud GUI navigate to the update pane click on &#8220;Start Update&#8221; in the Updater. The Update should now run through without any problems.<\/p>\r\n\r\n\r\n\r\n<p>At the end of the update procedure, choose to switch off maintenance mode. In case this does not happen automatically, you can switch it off via console:<\/p>\r\n<pre class=\"lang:default decode:true \">sudo -u www-data php \/var\/www\/owncloud\/occ maintenance:mode --off<\/pre>\r\n<h1>5. Finalize Update by reopening the Login home page<\/h1>\r\n\r\n\r\n\r\n<p>Use your browser of your desktop to navigate to the Nextcloud login page. It may be that you have to trigger the finalization of the update by clicking some button like &#8220;Finish update&#8221;. This will take another couple of minutes.<\/p>\r\n\r\n\r\n\r\n<p>To be on the safe side, log in with your administrator account and go to the Settings, choose &#8220;Overview&#8221; from the &#8220;Administration&#8221; section on the left side of the window and check the Security and Setup warnings.<\/p>\r\n<p>Keep in mind though, that not all warnings require immediate action:<\/p>\r\n<ul>\r\n<li>Updating the database to support 4-byte characters has failed on my MariaDB 10.1 installation and led to trouble with the database. There are a lot of postings out which report problems with exceeding the maximum key length (1000 or 761). While this issue is not sorted out, I recommend to disregard the instruction from Nextcloud and leave everything as it is.<\/li>\r\n<li>Equally little sense makes the instruction to upgrade to a new PHP version. If this was available for my Raspian it would already have been installed by the usual update \/ upgrade routine.<\/li>\r\n<li>I could not find any explanations on how to configure a memory cache on an RPi Zero device. Given that the device has limited RAM, I suppose that the recommendation makes only sense for servers equipped with larger memory.<\/li>\r\n<\/ul>\r\n<h1>6. Cleanup<\/h1>\r\n<p>Reset file permissions by running the <code>sudo fixperm.sh<\/code> script in the <code>\/home\/pi<\/code> directory.<\/p>\r\n<p>Reset the Nginx timeouts by putting them back to 600 and commenting them out. Keep in mind, that you have to reload the parameters into nginx by <code>sudo service nginx reload<\/code>.<\/p>","protected":false},"excerpt":{"rendered":"<p>While the updater GUI is really comfortable, I regularly run into difficulties with file permissions and timeouts. This post summarizes the steps needed to run an update via Nextclouds Update<span class=\"more-button\"><a href=\"https:\/\/hobbykeller.spdns.de\/?p=1208\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\">Updating Nextcloud via Updater GUI<\/span><\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[64,237],"tags":[268,267,179],"class_list":["post-1208","post","type-post","status-publish","format-standard","hentry","category-linux","category-raspberry","tag-file-permissions","tag-nextlcoud","tag-update"],"_links":{"self":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts\/1208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1208"}],"version-history":[{"count":3,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts\/1208\/revisions"}],"predecessor-version":[{"id":1243,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts\/1208\/revisions\/1243"}],"wp:attachment":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}