You are not logged in.

#1 2024-10-23 16:57:44

bluwatch
Member
Registered: 2024-10-23
Posts: 4

[SOLVED] cannot setup nextcloud with a different data directory

Hi, this is my first topic, so I apologize if I do something incorrectly. Please tell me if I do.

I setup nextcloud successfully according to the wikipage, but I forgot to set the data directory to my second drive. No matter what I tried to change the dir, even reinstalling did not help, I cannot set the data directory anywhere else besides "/var/lib/nextcloud/data".

When reinstalling and specifying a different data dir in "occ maintenance:install" the command fails and outputs:

Cannot create or write into the data directory /var/opt/nextcloud/data

When trying to change the dir after a successful installtion in the nextcloud config, nextcloud just complains that there is no ".ocdata" file eventhough there is.

I also checked if it is a permissions problem, and made sure that nextcloud user has the correct permissions and at the end even every user has full access, but this did not solve the problem.
I read through many forums and for other distros or the docker and snap variant it seems to work flawlessly, but the newest post i found was already about 1 year old, so I'm not sure if it is an arch specific issue.

Nextcloud now follows the web application package guidlines and thus the persistant storage should be in "/var/lib/nextcloud", but I am not sure if this is a must.

I am not sure if I did a stupid mistake or if this is a bug or intentional and enforced because of the web application package guidlines.
Can anyone help me here I don't know how to continue here.

Last edited by bluwatch (2024-10-24 11:15:08)

Offline

#2 2024-10-24 04:01:56

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [SOLVED] cannot setup nextcloud with a different data directory

While this will not fix your actual problem, you could mount your data partition to /var/lib/nextcloud directly and dodge the whole configuration bullet. Make sure to properly copy everything Nextcloud set up there, permissions and all.

Offline

#3 2024-10-24 06:04:08

someUser
Member
Registered: 2021-01-03
Posts: 17

Re: [SOLVED] cannot setup nextcloud with a different data directory

If you use php-fpm, make sure ReadWritePaths is set correctly in the systemd service file https://wiki.archlinux.org/title/Nextcl … md_service

Offline

#4 2024-10-24 06:53:41

bluwatch
Member
Registered: 2024-10-23
Posts: 4

Re: [SOLVED] cannot setup nextcloud with a different data directory

someUser wrote:

If you use php-fpm, make sure ReadWritePaths is set correctly in the systemd service file https://wiki.archlinux.org/title/Nextcl … md_service

I added the path "/multimedia/nextcloud" to the drop-in file, restarted the service. I gave correct permissions to the directories, drwxr-xr-x for "/multimedia/nextcloud" and drwxrwx--- for "/multimedia/nextcloud/data", "nextcloud nextcloud" is ownership for both dirs. After that ran the occ install command with "/multimedia/nextcloud/data" as data dir again, but unfortunately it's still the same error.

What am I missing here?

Offline

#5 2024-10-24 09:16:15

bluwatch
Member
Registered: 2024-10-23
Posts: 4

Re: [SOLVED] cannot setup nextcloud with a different data directory

Awebb wrote:

While this will not fix your actual problem, you could mount your data partition to /var/lib/nextcloud directly and dodge the whole configuration bullet. Make sure to properly copy everything Nextcloud set up there, permissions and all.

Thank you this worked, but is not my preferable solution, as I have different files on the drive as well and I don't want to split the drive into two partitions.

Offline

#6 2024-10-24 09:45:41

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [SOLVED] cannot setup nextcloud with a different data directory

You could try a bind mount, folder to folder.

Offline

#7 2024-10-24 11:12:56

bluwatch
Member
Registered: 2024-10-23
Posts: 4

Re: [SOLVED] cannot setup nextcloud with a different data directory

Awebb wrote:

You could try a bind mount, folder to folder.

That works perfectly, thank you smile

Offline

#8 2024-10-24 16:24:05

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [SOLVED] cannot setup nextcloud with a different data directory

I'm glad it did! It means I can do it, too, now :-P

Offline

Board footer

Powered by FluxBB