Change path of downloaded updates

I am looking to find a way to change the file path that the web updater downloads files to.
I am running into a file permission issue I believe when updating.

Currently I am on Nextcloud 19.0.6 with Debian Buster as the OS.
My data directory is currently a mounted NFS share on my virtual FreeNAS box. My config.php entry for the data folder is as:

'datadirectory' => '<NextcloudDataPath>',

My /etc/fstab file as a line with the following information for mounting the NFS share:

<FreeNAS IP>:/<SharePath> <NextcloudDataPath> nfs rw,async,hard,intr,noexec 0 0

Both paths are the same for the datadirectory and my NFS mount path. All of the files in this NFS share when doing a ls -l show that ownership is root:root. However I am fully able to add new file, edit and remove files in my instance.

The problem comes up when attempting to run the updater via the web or via the CLI. For some reason the updater folder gets permissions that it doesn’t like which then locks up the installer process. The only way to update is then manually updating by removing all but the config/ folder and moving all new files back in place. (Updating installed apps works no issue)

Is there a way in the config.php to specify a new path so I can point this path to somewhere outside my NFS share?

My apache2 config:

<VirtualHost *:443>
ServerName nextcloud.

        ServerAdmin <myemail>
        DocumentRoot /var/www/html

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

<Directory /var/www/html/>
Options +FollowSymlinks
AllowOverride All
Require all granted
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
</IfModule>
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/html
SetEnv HTTP_HOME /var/www/html
</Directory>

<Proxy "https://nextcloud.<mydomain>/updater/">
  ProxySet connectiontimeout=6000 timeout=6000
</Proxy>

Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/nextcloud.<mydomain>/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/nextcloud.<mydomain>/privkey.pem
SSLOpenSSLConfCmd Curves X448:secp521r1:secp384r1:prime256v1
SSLOpenSSLConfCmd ECDHParameters secp384r1
</VirtualHost>
</IfModule>
1 Like

Hey,
looks like I’ve a similar problem. Did you find any solution?

Hi @Resk and @DanielJay,

I too am having trouble upgrading with a data folder that is mounted over NFS.

How did you manage doing this ?

Could you share a step by step guide ?

So far, here is what I tried:

  • Backup config.php
  • Launch Upgrade from WebGUI
  • It fails at “Moving files” (almost last step)
  • From the data folder, in the “updater-xxxxxxxxxxxx/downloads” folder, move the ‘nextcloud’ folder, replacing the old one that sits in ‘/var/www’.
  • Replace config.php with backed-up one
  • run ‘occ upgrade’

This didn’t work for me… the ‘occ’ tool throws another exception.

Let me know how you did it if you managed to upgrade !

Unfortunately I face similar issues since my data folder is on a Windows SMB share. Access denied errors are displayed.

The extraction of the downloaded nextcloud-zip takes more than one hour (!) and the movement to the final destination is also ~ 30 minutes.

I tested the update process on a similar configurated VM on local storage and the extraction was ~ 15s (!) and the move also.

It would be very nice if the download or the updater directory could be pointed to a different directory (e.g. local storage).

Best regards
(C)opeman

Maybe you can set in config/config.php:
'updatedirectory' => '',

documentation updatedirectory

1 Like

Many thanks, devnull. This works! Update takes now 5 minutes instead of 5 hours.

1 Like