Issue with restoring NextcloudPI install

So my Nextcloud server crashed a couple of days ago. I have backups of the data along with the config using NextcloudPI’s backup and snapshot system. I managed to reimage the sdcard to get an instance of Nextcloud running once again on my Odroid HC1, but when I try to restore a backed up NC instance using NC-restore I get a long list of errors similar to this "tar: nextcloud/…/…: Cannot mkdir: Read-only file system.

The backups reside on an external usb harddrive which I have mounted via automount. I was hoping it was a simple as clicking a few buttons, but I’ve tried all 4 of the backup instances and they all fail.

Any help would be greatly appreciated,
Robert

I’ve since re-installed NextcloudPI and setup the data directory to the correct location. Everything seems to be working fine, I can create users etc. But when I try to restore my data using BTRFS I now get the following in the console window:

[ nc-restore-snapshot ] (Wed May 12 11:40:35 EDT 2021)
Create a readonly snapshot of ‘/media/myCloudDrive/ncdata’ in ‘/media/myCloudDrive/ncdata/…/ncp-snapshots/autobackup_2021-05-12_114037’
snapshot autobackup_2021-05-12_114037 generated
Maintenance mode enabled
Delete subvolume (no-commit): ‘/media/myCloudDrive/ncdata’
ERROR: cannot snapshot ‘/media/MyBackupDrive/ncp-snapshots/daily_2021-04-30_141706’: Invalid cross-device link
Create a snapshot of ‘/media/MyBackupDrive/ncp-snapshots/daily_2021-04-30_141706’ in ‘/media/myCloudDrive/ncdata’
{“reqId”:“WYDPLQqfSQeJo3dMCIzZ”,“level”:2,“time”:“2021-05-12T15:40:39+00:00”,“remoteAddr”:"",“user”:"–",“app”:“no app in context”,“method”:"",“url”:"–",“message”:“Temporary directory /media/myCloudDrive/ncdata/tmp is not present or writable”,“userAgent”:"–",“version”:“20.0.8.1”}
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/20/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:168
Stack trace:
#0 /var/www/nextcloud/console.php(99): 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}
{“reqId”:“2SvUbaryfLhZSwAwAklh”,“level”:2,“time”:“2021-05-12T15:40:39+00:00”,“remoteAddr”:"",“user”:"–",“app”:“no app in context”,“method”:"",“url”:"–",“message”:“Temporary directory /media/myCloudDrive/ncdata/tmp is not present or writable”,“userAgent”:"–",“version”:“20.0.8.1”}
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/20/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:168
Stack trace:
#0 /var/www/nextcloud/console.php(99): 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}snapshot /media/MyBackupDrive/ncp-snapshots/daily_2021-04-30_141706 restored

I have no idea what this all means.

Is there a certain order to do restore? Should I

  1. Reinstall Base Nextcloudpi
  2. Setup Users
  3. Readd apps
  4. Attempt to restore Nextcloud Backup
  5. Restore ncdata
  6. Scan Files
  7. Check Permissions

I’m not worried about my actual files, however I did have multiple recipes in Cookbook that I would like to get back but I dont know if they reside in ncdata or in the actual nextcloud folder or just a database?

Robert