Tried to move my data directory, failed spectacularly


Running ncp on an odroid xu4 with one 1TB external hdd.
I picked up a nice 500GB ssd from amazon thinking that I would move my Nextcloud data directory there. So I connected it, formatted it to btrfs using the ncp-panel, and thought I would just have to rsync my existing datadir from my external hdd media/myCloudDrive to my new ssd media/mainssd.

HDD ls -al:

total 20
drwxr-xr-x 1 root root 138 Nov 28 08:15 .
drwxr-xr-x 3 root root 4096 Nov 28 08:30 …
drwxr-xr-x 1 root root 0 Nov 27 21:16 mainssd
drwxr-xr-x 1 root root 0 Nov 28 08:16 ncdata
drwxr-x— 1 www-data www-data 220 May 20 2018 ncdata-05-20-18
drwxr-x— 1 www-data www-data 218 May 20 2018 ncdata-05-21-18
drwxr-x— 1 www-data www-data 340 Sep 29 19:07 ncdata-11-28-18
drwxr-xr-x 1 root root 314 Nov 22 03:02 ncp-backups

So I executed as su

rsync /media/myCloudDrive/* /media/mainssd

But that didn’t work because I didn’t have enough space on my ssd. I then deleted ncp-backup, ncdata-05-20-18 and ncdata-05-21-18 thinking those were all the backups from the ssd (still have my backups). So I was left with ncdata on my ssd.

No I went back to the ncp-panel and executed nc-datadir pointing to /media/mainssd/ncdata. Now this didn’t work, just got a red dot in the web ui. “Well that didn’t work” I thought and ran nc-datadir back to /media/myCloudDrive/ncdata" and ran it.

Now I am greeted with a nice

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

Your data directory is not writable

Permissions can usually be fixed by giving the webserver write access to the root directory. See

when accessing my nextcloud in the browser.

My config.php reads under datadirectory /media/USBdrive/ncdata.

(USBdrive -> /media/myCloudDrive)

Is this situation still salvageable? On the plus side I still have all my files, and I have a 7 day old backup on my HDD, but I thought I would try here first, maybe you guys can help me.

sudo ncp-report:

The data dir needs to be owned by and writable to www-data

sudo mkdir /media/mainssd/ncdata

sudo chown -R www-data /media/mainssd/ncdata

sudo chmod 755 -R /media/mainssd/ncdata

After that you should be able to move your data there, using ncp-config>nc-datadir.

For further reference

Had to reinstall my nextcloud, but that still helped getting my hard drives running, thanks!