Moving data directory in Nextcloud 11.0.2

Nextcloud version _(11.0.2)
Operative system and version (Raspbian Jessie Kernel 4.9):
Apache or nginx version (Apache 2.4.25):
PHP version (5.6):
Im trying to move my data directory into my hardruve so any file I upload go into my hardrive not my raspberry pi sd card. I’ve tried pointing the config file to the path and also moving all the data from the default location to the hardrive path. But nothing I just get a white page when trying to load up nextcloud :frowning:

As you moved your data directory already, I guess Nextcloud already cleaned the oc_filecache, so solution 1 could not work anymore and shares/tags/comments would be lost. Do you have a database dump in case? If not, just do the occ files:scan --all command to create the new filecache entries.

I haven’t found instructions on how to assign a new data directory during installation process.Is their a thread ? Thanks in advance for your help

https://docs.nextcloud.com/server/12/admin_manual/installation/installation_wizard.html#data-directory-location

Thanks for the link ! But I’m trying to write the data in a removable USB drive and when I enter the path (media/pi/6c19-22f8/nextcloud/data) it’s says "can’t create or write into that directory .

Did you chown -R www-data:www-data the directory to gain write access to the webserver user?

yeah i tried to do that but the output is chown: changing ownership of ‘/media/pi/6C19-22F8/nextcloud/data’: Operation not permitted

Did you try as root user it with sudo?

Yeah I entered sudo bash and went as root user but it says the same thing

i even tried today to format the usb drive into ext4 filesystem with no success