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...