Nextcloud does not scan or 'know' of new data dir

My YunoHost server

Hardware: VPS bought online
YunoHost version: 4.1.8
I have access to my server : Through SSH

Description of my issue

I changed the data dir for my nextcloud but cannot scan for new files, it says the dir for my user is not writable.
I tried executing it as www-data but that gives me the problem that config directory is not writable and/or that console has to be executed with user that owns config.php.

# sudo -u nextcloud php7.3 occ files:scan --all
Starting scan for user 1 out of 1 (xxx)
Home storage for user xxx not writable
Make sure you are running the scan command only as the user the web server runs as
| Folders | Files | Elapsed time |
| 0       | 0     | 00:00:00     |

But I did change the owner of the folder containing all data to nextcloud recursively:

drwxrwx---  7 nextcloud nextcloud  296 May  5 13:17 storagebox

And I have a .ocdata file there as well (which was a problem at first)

root@yh:/mnt# ls -lha storagebox/
total 216K
drwxrwx--- 7 nextcloud nextcloud  296 May  5 13:17 .
drwxr-xr-x 9 nextcloud nextcloud  296 May  5 13:16 appdata_ocni2ff5yrjd
drwxr-xr-x 5 nextcloud nextcloud  336 May  5 13:29 data
drwxr-xr-x 2 nextcloud nextcloud  104 May  5 12:55 files_external
drwx------ 2 root      root      5.7K May  5 13:22 lost+found
drwxr-xr-x 3 nextcloud nextcloud  104 May  5 13:16 xxx
-rw-r--r-- 1 nextcloud nextcloud 207K May  5 13:17 nextcloud.log
-rw-r--r-- 1 nextcloud nextcloud    2 May  5 12:54 .ocdata

So what can be done to make nextcloud scan my files and acknowledge my new data dir?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.