Using an existing BTRFS filesystem with NCP


I had used the NCP first time setup wizard to move all my data to a USB drive (it used to automount in /media/myCloudDrive). Everything worked fine until recently when my drive had a hardware failure. Thankfully I have a daily backup of the ncdata and ncp-backups dirs (using duplicity to a remote machine), so I created a new BTRFS filesystem manually on a new USB drive and restored these dirs.

Now Nextcloud itself works great but if I try to run nc-snapshot I get:

Running nc-snapshot
Maintenance mode enabled
Nextcloud is in maintenance mode - no apps have been loaded

ERROR: not a btrfs filesystem: /media/myCloudDrive/../ncp-snapshots
Maintenance mode disabled

I guess that is because the NCP setup wizard might have done some more setup that is not present in the BTRFS filesystem I created myself. So what should I do now? Is there a list of such missing things that I should create myself, or can I run something to create those automatically?

Maybe my issue from yesterday could help you

Thanks! I’m a bit embarrassed that I missed that thread -.-

@nachoparker I tried what you suggested on the other thread and got this:

Running nc-datadir
Maintenance mode enabled
moving data directory from /media/myCloudDrive/ncdata to /media/myCloudDrive/ncdata1...
BTRFS filesystem detected
Create subvolume '/media/myCloudDrive/ncdata1'
mv: cannot remove '/media/myCloudDrive/ncdata': Directory not empty
Done. Press any key...

# ls /media/myCloudDrive/ncdata

I’m guessing the Directory not empty was because of the nextcloud.log that was left behind. Now my data has been moved to ncdata1 but config.php was not updated:

# ls /media/myCloudDrive/
ncdata  ncdata1  ncp-backups.bak
# ls /media/myCloudDrive/ncdata1/

# ls /media/myCloudDrive/ncdata1/data/
appdata_ocfgwleo0gzc  index.html  nextcloud.log  shantanu user2  tmp

# grep /media /var/www/nextcloud/config/config.php
  'datadirectory' => '/media/myCloudDrive/ncdata',
  'tempdirectory' => '/media/myCloudDrive/ncdata/tmp',
  'logfile' => '/media/myCloudDrive/ncdata/nextcloud.log',

Is it safe for me to manually change all that to ncdata1 paths, or would nc-datadir have missed some other important steps (besides updating the config) because of the Directory not empty error?

I took another backup and simply manually moved ncdata1/* back to ncdata, deleted nextcloud.log and this time nc-datadir worked fine.