HowTo: Change / Move data directory after installation

You are aware that you are writing within exactly this topic? :smile:
How did you land here, but not reading the OP? However, forum navigation is sometimes weird, especially on huge topic like this, so all good.

I regularly update my HowTo’s, when required. See last edit timestamp. It is from today, and there are many more recent edits :wink:.

True. I like to give background information, but it is a double-edged sword.

I wasn’t aware that the Nextcloud documentation covers this at all. When I wrote this HowTo, Nextcloud staff simply saw this as unsupported move. While the symlink method is simpler, it is also kinda unclean, IMO, and it does not cover the security aspect of having the data dir outside of webroot. I definitely prefer method 1, hence I also made this no. 1. With the update today, I simplified the database update steps, so no manual MariaDB console typing anymore, but all can be copy&pasted into the shell. But I understand that generally accessing the database is a little worrying for some, hence method 2 is mentioned as well.

But thanks for the feedback. I am just thinking whether to put the “Background” into an expandable details, and add a tiny TOC for the two methods, like so:

Background

Click to read

Nextcloud looks up … bla blub …


Solution 1: Move data dir with database change
Solution 2: Link data dir without database change

EDIT: I just read this short points about the topic in Nextcloud docs. It is for relatively experienced admins, indeed, without giving any command-line command details etc. I do wonder that it mentions the symlink method as “safe moving of data directory, supported by Nextcloud”, as it collides with security recommendations to never have such data within the webroot itself (a symlink practically means the same), if one can avoid it. A properly configured webserver prevents direct access, but it is so easy to break this, with a little mistake at the webserver config. I’ll open a PR to have this docs section changed, as I think it is dangerously wrong.