How to change file directory Nextcloud in Nethserver

@danb35

Hello!
please

some days I am trying to follow way for change disk to users files. Many docs are for debian family way. The docs more Nethserver way that I found was:

at first time I did try change the disk/directory but I broke Nextcloud
Now, I did a clean installation

My steps:
01 - I update php 5.4 to 7.2
02 - Install Nextcloud by web nethserver and ok, its working nice! But i want (in future) put users files in other disk.
03 - The Nextcloud is maintenance on

And here I am lost about what next step??

Here:
Yes. Before doing that, you’d want to:

  • put Nextcloud into maintenance mode
  • Move everything from /var/lib/nethserver/nextcloud somewhere else (so the nextcloud directory is empty)
    Then mount your device there, move everything back, and take Nextcloud out of maintenance mode.
    OTOH, you might want to mount the disk at /var/lib/nethserver , to provide storage for all your data.

Mount the device there, move everything back??

and: OTOH, you might want to mount the disk at /var/lib/nethserver , to provide storage for all your data -

mount where?

I am sorry, I did read a Lot of topic about this! I can not get right or better way to fix it!

Thanks attention

really not tested this corner case, but what about to mount the /var/lib/nethserver/nextcloud/ through the /etc/fstab

this is on my server how I make a mount

/dev/sdc1 /var/lib/sauvegarde-6T ext4 defaults 0 2

Hello @stephdl
how are you?

But, do you use Nextcloud in this mode (mount as you show?)
I think mount is not my problem. My doubt is how to change disk/directory users files from Nextcloud without brake Nextcloud. Do the changes in right way! I am new in adopt Nethserver but, we want let it be production machine next year!

thanks

Wrong; there’s no reason to update PHP, and lots of reasons not to (mainly that it will break things).

You should set that up before you install nextcloud. Changing the Nextcloud data directory isn’t straightforward, and it will likely break when you install an update due to the templating system used by Nethserver.

It is exactly your problem. Your question is a special case of the more common question, “how do I store my user data on a separate drive/array?” The answer, there as here, is to create a filesystem on that disk/array and mount it to the desired place in your directory tree–ordinarily that will be at /var/lib/nethserver. If you only want the Nextcloud data stored there, and not anything else (user emails, etc.), you might instead mount it at /var/lib/nethserver/nextcloud.

There isn’t a good/safe way to tell Nextcloud (as it’s implemented in Nethserver) to store its data in a different directory, but it’s pretty straightforward to have it store it on a different disk or array.

3 Likes

@danb35
hello!

Thank you for your considerations and answer. After this! I will start a nethserver clean installation (it is does not in production). I will try to do step by step.

Thank you