Ubuntu 20.04 LTS Snap Installer -- Change Data Directory

Hi! I was installing my Ubuntu Server the other day and came across nextcloud in the snap menu and after looking into it, I am really interested! I think the title is pretty self explanatory, but basically I need help changing the data directory nextcloud uses. I have a 128gb ssd which I am using for the OS and some quick access files, but I have two one TB HDDs in RAID 1. I would like to move the data dir from somewhere in /etc to the HDDS which I have mounted in my /opt folder. I have tried editing the autoconfig.php which is in /var/snap/nextcloud/current/nextcloud/config and then transferring ownership of my /opt/nextcloud/data directory to www-data:www-data with chown. When I then try visiting the website I get " Error Can’t create or write into the data directory /opt/nextcloud/data" when I try to make my admin account.

I am very new to this and I have only skimmed the setup documentation (most of which seems to be for a php server that I’d like to avoid if at all possible) and looked at a bunch of forum help. I could be missing something easy, but anything helps :slight_smile:

Turns out I am a dummy and just skipped a line in the documentation. In case anyone else comes across this, if you are using snap, as far as I can tell your directory has to be the default dir or in /mnt or /media!