Nextcloudpi nc-restore error - Cannot create "data" directory

I’m trying to restore a Nextcloudpi backup using the nc-restore tool, however I’m getting error messages when I try (copied below). I’m doing this on a new Nextcloudpi instance (just to test that I can successfully restore a back up), and using a dataless backup plus a BTRFS snapshot. I have set both the data and database directories to be in a BTRFS formatted USB pendrive.

Running nc-restore
check free space...
extracting backup file /media/ncbackup/ncp-backups/nextcloud-bkp_20191023_1571774402.tar...
restore files...
restore database...
no datadir found in backup
Cannot load Zend OPcache - it was already loaded
PHP Warning:  fileperms(): stat failed for /media/ncprimary/ncdata/nextcloud.log in /var/www/nextcloud/lib/private/Log/File.php on line 140
{"reqId":"u3J0UlaLZHckHbGoKGwX","level":3,"time":"2019-10-24T01:34:49+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fileperms(): stat failed for \/media\/ncprimary\/ncdata\/nextcloud.log at \/var\/www\/nextcloud\/lib\/private\/Log\/File.php#140","userAgent":"--","version":"16.0.3.0"}
{"reqId":"u3J0UlaLZHckHbGoKGwX","level":2,"time":"2019-10-24T01:34:49+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Temporary directory \/media\/ncprimary\/ncdata\/tmp is not present or writable","userAgent":"--","version":"16.0.3.0"}
Your data directory is invalid
Ensure there is a file called ".ocdata" in the root of the data directory.

Cannot create "data" directory
This can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/16/go.php?to=admin-dir_permissions

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /var/www/nextcloud/console.php(96): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#2 {main}PHP Warning:  fileperms(): stat failed for /media/ncprimary/ncdata/nextcloud.log in /var/www/nextcloud/lib/private/Log/File.php on line 140
{"reqId":"u3J0UlaLZHckHbGoKGwX","level":3,"time":"2019-10-24T01:34:49+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fileperms(): stat failed for \/media\/ncprimary\/ncdata\/nextcloud.log at \/var\/www\/nextcloud\/lib\/private\/Log\/File.php#140","userAgent":"--","version":"16.0.3.0"}
{"reqId":"u3J0UlaLZHckHbGoKGwX","level":3,"time":"2019-10-24T01:34:49+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"chmod(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Log\/File.php#141","userAgent":"--","version":"16.0.3.0"}
Cleanup...
Done. Press any key...

OK I did a clean install and this time I managed to restore the database using nc-restore (I gave the partition I’m restoring to the same name as the original - not sure if that made the difference).

Now I’m trying to restore the actual data from a btrfs snapshot using nc-restore-snapshot but I’m getting similar errors:

Running nc-restore-snapshot
Create a readonly snapshot of '/media/ncprimary/ncdata' in '/media/ncprimary/ncdata/../ncp-snapshots/autobackup_2019-10-24_160558'
snapshot autobackup_2019-10-24_160558 generated
Maintenance mode enabled
Delete subvolume (no-commit): '/media/ncprimary/ncdata'
ERROR: cannot snapshot '/media/ncbackup/ncp-snapshots/hourly_2019-10-23_041701': Invalid cross-device link
Create a snapshot of '/media/ncbackup/ncp-snapshots/hourly_2019-10-23_041701' in '/media/ncprimary/ncdata'
PHP Warning:  fileperms(): stat failed for /media/ncprimary/ncdata/nextcloud.log in /var/www/nextcloud/lib/private/Log/File.php on line 140
{"reqId":"bK4kDs72dNgzSEwdeFnP","level":3,"time":"2019-10-24T15:06:01+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fileperms(): stat failed for \/media\/ncprimary\/ncdata\/nextcloud.log at \/var\/www\/nextcloud\/lib\/private\/Log\/File.php#140","userAgent":"--","version":"16.0.3.0"}
{"reqId":"bK4kDs72dNgzSEwdeFnP","level":2,"time":"2019-10-24T15:06:01+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Temporary directory \/media\/ncprimary\/ncdata\/tmp is not present or writable","userAgent":"--","version":"16.0.3.0"}
Your data directory is invalid
Ensure there is a file called ".ocdata" in the root of the data directory.

Cannot create "data" directory
This can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/16/go.php?to=admin-dir_permissions

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /var/www/nextcloud/console.php(96): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#2 {main}PHP Warning:  fileperms(): stat failed for /media/ncprimary/ncdata/nextcloud.log in /var/www/nextcloud/lib/private/Log/File.php on line 140
{"reqId":"bK4kDs72dNgzSEwdeFnP","level":3,"time":"2019-10-24T15:06:01+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fileperms(): stat failed for \/media\/ncprimary\/ncdata\/nextcloud.log at \/var\/www\/nextcloud\/lib\/private\/Log\/File.php#140","userAgent":"--","version":"16.0.3.0"}
{"reqId":"bK4kDs72dNgzSEwdeFnP","level":3,"time":"2019-10-24T15:06:01+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"chmod(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Log\/File.php#141","userAgent":"--","version":"16.0.3.0"}
PHP Warning:  fileperms(): stat failed for /media/ncprimary/ncdata/nextcloud.log in /var/www/nextcloud/lib/private/Log/File.php on line 140
{"reqId":"DgEYS4sHWtmvT7VKxXBW","level":3,"time":"2019-10-24T15:06:02+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fileperms(): stat failed for \/media\/ncprimary\/ncdata\/nextcloud.log at \/var\/www\/nextcloud\/lib\/private\/Log\/File.php#140","userAgent":"--","version":"16.0.3.0"}
{"reqId":"DgEYS4sHWtmvT7VKxXBW","level":2,"time":"2019-10-24T15:06:02+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Temporary directory \/media\/ncprimary\/ncdata\/tmp is not present or writable","userAgent":"--","version":"16.0.3.0"}
Nextcloud is in maintenance mode - no apps have been loaded

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

Cannot create "data" directory
This can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/16/go.php?to=admin-dir_permissions

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:166
Stack trace:
#0 /var/www/nextcloud/console.php(96): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#2 {main}PHP Warning:  fileperms(): stat failed for /media/ncprimary/ncdata/nextcloud.log in /var/www/nextcloud/lib/private/Log/File.php on line 140
{"reqId":"DgEYS4sHWtmvT7VKxXBW","level":3,"time":"2019-10-24T15:06:02+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fileperms(): stat failed for \/media\/ncprimary\/ncdata\/nextcloud.log at \/var\/www\/nextcloud\/lib\/private\/Log\/File.php#140","userAgent":"--","version":"16.0.3.0"}
{"reqId":"DgEYS4sHWtmvT7VKxXBW","level":3,"time":"2019-10-24T15:06:02+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"chmod(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Log\/File.php#141","userAgent":"--","version":"16.0.3.0"}
snapshot /media/ncbackup/ncp-snapshots/hourly_2019-10-23_041701 restored