How do I recover the files from the disc i used as datadisc?


Now I need help with this.

I had a nextcloudpi working and took one backup every week to a second usb-drive. After a crash in the middle of a backup it could not find my ncdata and also it could not find any of my backups. For the record, I followed the guides.

Now I have a new NCP up and running on a new USB-drive. Everythings fine and I can mount the other 2 usb-discs as external storage. Everything fine so far.
Now I need to recover those files to the new disc or to my ntfs-windows-backupdisk.

I need a way to ether

1: Access the external files using samba to move and recover my files. I know I can see them in Webdav but it fails to download, so I can download the files.

2: Find a way to mount my old ncdata disc to windows and copy files to new drive.

3: I tryed to create a virtual box and copy files and also a raspberrian distro on pi and I can see the files but does not have access to them.

4: Use webdav to copy files but it fails as the certificate does not match. Dont know why.

5: Find a way to copy files using web-nextcloud but it fails on larger files.

So. Some of my files are bigger then 2 gb (up to 16 gb) and added using samba and I want them recovered. How?

I do not use NextcloudPi. But there are features perhaps also for restore.

Normally i would restore files from the command line. You wrote that you mount the drives. Very good. You can also use SSH (Putty) to connect to your nextcloudpi?

You can then copy files to the right position on the the data-dirs. You must set the correct user and rights with chown and chmod.

Then you can use
sudo -u www-data php occ files:scan --all

Test it perhaps with only one file for nextcloud-data and for external-storage.

If the nextcloud crashes internally (perhaps user …) you need to restore the MariaDB. That is another theme. Do you backup the database (dump)?


Ok. I have ssh setup and can access ncp-config.
Have tryed to use some other commands I know like ls (does nothing, cd home (says command not found).

As I am familiar to windows (sorry) I need some help to find and list the files and also how to copy them to the new disc. I have the same user, the default ncp and same password. The ssh login is pi. I have no experience of how use chown and chmod.

I need to copy 73 gb of files.

The crash I had was in a middle of a 75 GB backup with data and it reseted something so it did not found the data drive anymore and also It could not find any of my backups. I can see them on my disc but… NCP will not see them.

I just want the files back.

I think instead of remote-copy all files
cp -r /path/to/backup /path/to/nextcloud/data
you can perhaps better use rsync
rsync -av /path/to/backup /path/to/nextcloud/data

But you need a little more know how. Do not destroy your backup.

Before going any further, can you be very specific about how you were backing up?

Yes. I followed The instruktion for ncp and backuped ewery week at night before thursday.
Compressed and included data. Worked 4 weeks and then crashed and thats why I want to recover The files and not use The backup. It does not read The backup anyway. I did a lot of change The last week. Added files.

Thats why.

I now managed to learn some ssh.
Copyed some files but i do not have The right. Change to 777 and Copyed file after file. Some files have still wrong rights. Does not work.

I installed Midnight commander and Will try to use it to copy files. Seems a little bit more easy.

Hey Blafot,

As you said you achieved No3, lets keep working that way.

What you probably need is just to use the occ command to re-scan for all files and for every user after you successfully mounted your drive.

So you have your brand new NC with your users, you copy their files in each ones’ folder and then to the occ scan command. Once done, everyone should see their files.

That of course is if you did not used server-side encryption… In that case, you need also to restore your database before being able to decrypt the content.

Hi again and thank you for your answers.

Now I think I have managed to get the files recovered to the new disc.

What I did was that I had SSH setup and had to read a lot of how it works as I am a Windows user. :slight_smile:
Then I fiddled around and tryed to move files but I dod not get it working more than one file at at the time.

I figured out that I could install Midnight Commander using SSH and run it as su. Wow.
Then I copied all files to new disc and now I thing all files are at my new server (I have to test the files).

So… Failed to copy using WebDav and also the NC-web interface.
Worked (I think) using MC.

As a new backupstrategy I will use sheduled backups and snapshot without data every day and once a week copy the ncdata manually using MC and ssh as ncp did not read my backup archives. Then I can recover files again next time it fails.