NextCloud Select your ouwn data location

After some time working with UNC, I’m currently review if I can provide UNC as the right solution to some off my Clients.
The default data location for nextcloud on UNC, is on " /var/lib/univention-appcenter/apps/nextcloud/data/nextcloud-data"

When I review this link https://help.nextcloud.com/t/is-there-a-safe-and-reliable-way-to-move-data-directory-out-of-web-root/3642/2 they recommend a reinstall reinstalling with your preferred directory location.
Can anyone tell me how I can install NextCloud on UNC and point my data to my preferred location?

perhaps a »bind mount« could help https://unix.stackexchange.com/questions/198590/what-is-a-bind-mount

$ < /etc/fstab grep nextcloud
/srv/nextcloud-data     /var/lib/univention-appcenter/apps/nextcloud/data/nextcloud-data        ext4    bind 0 0

Hi Thorsten, Thanks for your quick replay:
When I review the documentation it’s not clear for me how I can mount a nfs share
currently I mount the NFS share in /etc/fstat as:
192.168.1.216::mnt/NAS/CloudData /mnt/CloudData nfs4 auto 0 0
Can you provide, an example how I can bind the Nas location to the nextcloud data folder?

You could do this in a VM or snapshot first - it`s untested

If something doesn’t work: don`t blame me :face_with_raised_eyebrow:

service docker-app-nextcloud stop

du -sch /var/lib/univention-appcenter/apps/nextcloud/data/nextcloud-data
# how much space is taken? Can $HUGE_DIRECTORY capture this?

cp -rp /var/lib/univention-appcenter/apps/nextcloud/data/nextcloud-data/* /home/$HUGE_DIRECTORY

umount /mnt/CloudData

sed -i.bak 's#/mnt/CloudData#/var/lib/univention-appcenter/apps/nextcloud/data/nextcloud-data#' /etc/fstab

mount -a

chmod 0770 /var/lib/univention-appcenter/apps/nextcloud/data/nextcloud-data
chown www-data.www-data /var/lib/univention-appcenter/apps/nextcloud/data/nextcloud-data
cp -rp /home/$HUGE_DIRECTORY/* /var/lib/univention-appcenter/apps/nextcloud/data/nextcloud-data/

service docker-app-nextcloud start

Just a quick note: The App Center currently does a backup of all app files when updating an app into /var/lib/univention-appcenter/backup. I would suggest to mount the nfs share at /var/lib/univention-appcenter/

1 Like

Thanks for your help so far. It takes a moment, before I found time to work on this issue.

The /var/lib/univention-appcenter/apps/nextcloud/data/nextcloud-data is now mounted from my Freenas system. And the freenas is a member server from the same domain, but I can’t assign the access right’s. I receive a message Operation not permitted.

As I already mention, I’m a Windows Admin. Can one off you, drive me on the right direction, how I can solve this issue?
I’m assume I need first apply some access rights on the folder in Freenas, which one is shared as a nfs4 share, before I can change the access rights on the Univention system.

Thanks for your support!

Thanks for all your support,
I was still no able to resolve this issue, or I can’t mount the NFS share, or I was not able to change the data folder permissions.
At the end I change the NFS share to a ISCSI share, and this works very well for me.

Mastodon