MOVING DATA DIRECTORY TO HDD. I just can't figure this out!

I’ve studied several of the posts from HowTo: Change / Move data directory after installationhttps://help.nextcloud.com/t/howto-change-move-data-directory-after-installation/17170 as well as, “Is there a safe and reliable way to move data directory out of web root?”, but am so confused for how to do any of the steps explained. I did a snap install of nextcloud so I am not even sure if I can perform the steps from Solution 1 from HowTo: Change / Move data directory after installation thread. And when Solution 1 references such directories as “/path/to/nextcloud/occ” and “/new/path/to/data”, are these the actual names of the directories? If not, how do I find out these exact directory names? Thanks and sorry for the noobness of the post.

I hope /path/to/nextcloud is clear enough that you should use the actual path to your Nextcloud directory :smile:.

Not sure if this works on snap, actually I believe not. AFAIK the locations are fixed there (?). Check out the Nextcloud snap documentation for details about install/data locations and how to change them, if possible: https://github.com/nextcloud/nextcloud-snap

I get that /path/to/nextcloud but how do I find this exact path?

Read through the info page that I linked.

  • /path/to/nextcloud/config/config.php seems to be /var/snap/nextcloud/current/nextcloud/config/config.php
  • /path/to/data/ seems to be /var/snap/nextcloud/common/ or any of it’s sub directores.

Ah lol there is actually a guide on the Nextcloud Snap wiki: https://github.com/nextcloud/nextcloud-snap/wiki/Change-data-directory-to-use-another-disk-partition

  • Follow this one. I will link it from my HowTo as well.

I tried the steps from the link https://github.com/nextcloud/nextcloud-snap/wiki/Change-data-directory-to-use-another-disk-partition you’ve provided already for both approaches, and my experience for was not successful for either.

For the approach, “If you just installed the snap, and haven’t created an admin user yet”, when I changed the ‘directory’ in the autoconfig.php to my HDD, ‘directory’ => ‘/media/SATAHD’, and then went ahead with creating an admin user, it got changed back to ‘directory’ => getenv(‘NEXTCLOUD_DATA_DIR’),.

And when I tried changing config.php after creating an admin user, I got the following error: “ERROR Your data directory is invalid Ensure there is a file called “.ocdata” in the root of the data directory”.

Lost…