How to change Data Folder after install NC13

Hi,

I want to change my data folder. Now is /var/www/html/nextcloud/data i want /media/HDD ← is external storage and i would this directory default (home folder when i log in to NC13).
example

Nextcloud version 13.0.4
Operating system and version Ubuntu 16.04 LTS
Apache or nginx version last ( i install NC few days ago)
PHP version (like up)

What i try? :

After point 7 i have error about occ file

Which error do you get?

Point 7 is just to disable maintenance mode. You can do it also by change it in your.config.php

Your data directory is invalid
Ensure there is a file called “.ocdata” in the root of the data directory.

I used sudo chown -R www-data:www-data:/media/hdd and sudo chmod -R 755 /media/hdd

The error tells you what to do: Check if the invisible file .ocdata is in the new data directory.

Do:
cd /media/hdd
ls -la
When something is not correct, try to copy it again with some flags. cp -a or others. More insights gives you the command man cp :wink:

Dont use the : for your directory. It´s only

chown group:user /path

so
sudo chown -R www-data:www-data /media/hdd
will be correct.

Dont forgive permissions that way. Do it like this (step 9): Upgrade manually — Nextcloud 13 Administration Manual 13 documentation

cd /media/
sudo chown -R www-data:www-data hdd/
sudo find hdd/ -type d -exec chmod 750 {} ;
sudo find hdd/ -type f -exec chmod 640 {} ;

Cheers