[NC21] change user home folder

Hi I am running nextcloud 21.02, I have a simple question:
In a standard install with DB backend for users is it possible to change the default directory for the user files? I am not talking about changing the data directory, example:

Normally the user home directory for the user files is created like this:
./data/“user name”
Is it somehow possible to change this to?:
./data/userdata/“user name”

I would like to put all user data on a different disk. In the data folder much caching is done I don’t want this to be on the same disk (updater cache and appdata cache and logs are written directly under ./data)

I have seen the LDAP backend seems to support this, at least from what I have read.
Can this be done with DB backend too?

Best regards
Jonas Stunkat

In general the user directories are always located under the Nextcloud data directory. Therefore you cannot change it by adjusting any Nextcloud parameter etc.

Nevertheless you can still use a symbolic link on a Linux OS to point to a different directory, as long as you make sure that the web server user, which is used to run Nextcloud, is able to access the target directory and its data.

But in this case I would have to create links for each user folder, or did I miss something?

This is not what I expected. Hmm. I looked into the database and the

I think it might be really simple to implement just like changing the /data folder variable in the config file, it would have to be set before installation.
But I don’t know if this is all that would have to be done.

Thanks for reply.

Best Regards
Jonas Stunkat

it may be easy to adopt this. but why do you want to distribute files throughout the system? as @j-ed stated already it is possible to change/move the whole data directory - files of every user, group folders etc. I don’t see any reason to selectively move files of some user out of this directory. this would only add complexity to backup and monitoring, managing access rights…

If you have good reason feel free to file an issue or even better a pull request at github…

1 Like

I think I stated in my first post that I am aware of this, if not there than clearly in my second post.
I am not talking about moving the directory of one user outside of the data directory, I stated in my first post what I want including an example and reasons why I want this.

I want a separation of caching data and user data in an easy way, a way which is already possible with the LDAP backend, at least as far as I am aware of.

Additionally, there already is a config parameter to separate user cache from the data/user directory. ( ‘cache_path’ => ‘’, )

To clarify why I want this:

  • I am using rclone to mount a remote filesystem which hosts the /data directory
  • this works quite well, but has some problems with caching, it gets slow sometimes, I noticed this clearly during the update to 21.02 which took about 1 hour for a nextcloud installation that is quite new and shouldn’t take this long

So I don’t know why the decision was made to host each user in a separate folder directly under /data alongside log files updater folders, appdata folders etc. .
I don’t know too much about nextcloud internals but from a glance this looks like bad design and it would bring more structure to place user folders inside a folder inside the /data folder like I mentioned in my first post, something like /data/userfiles/username .

The whole reason I posted here first instead of GitHub or developer chats/forum is because I was unsure, maybe I missed something and what I wanted was already hidden somewhere.

As it seems there is no ready way to do this, what do you think, does what I have written make any sense? Would a pull request for something like this make more people than me happy?

Best regards
Jonas Stunkat

I still don’t get an advantage to move one/all user folders one level deeper in the file structure. I see the point application cache and logs have nothing to do with user data - but I would not expect this config has negative impacts on the performance. my appdata is 11G large - user data for a family is >70G don’t think moving away userdata would improve performance…

I think you you should review your setup - maybe remote file system with rclone is not the best setup for nextcloud /data storage…

I’m following the forums for a year now and didn’t see such request til now. But this is not the point - if you think your idea would improve Nextcloud - just raise an issue at github.