Data folder destroyed

Nextcloud 28.04
Ubuntu 22.04
3 users
The hardisk holding the data folder failed. The rest of the instance and database are on a separate disk and are unaffected.
All the data is backed up on the users PCs. I have mounted a new drive and created /nextcloud/data/users folders.
What is the best way to reinstate the data?
Thanks for any help

Are any of the users remote?

Just 1

I have renamed the old nextcloud folder and have installed v29.02 using the old config.php. The file names are now showing up in the dashboard, but I need a safe way of syncing from each of the pcs.

  1. I deleted one file on server then forced sync from my client and it restored 1 file.

  2. I then deleted all files and folders on the server for that user then forced sync again from client but I had heaps of error 403 on webdav put on all the folders that were missing.

  3. I restored all files via ssh then forced sync of client but then some files were missing after syncing with client.

Note: the Nextcloud server was not stopped in the above processes, will try again.

Thanks

I am using webdav in winscp and can see all the file names and attributes, presumably held in the database, but they will not upload to the new hard drive unless I manually create the folder first.
I think the way forward would be to write a script to scan the database to create a folder tree in the /data/files/ folder for each user. This is way beyond my capabilities.

@Raydon Thanks for the reply.

Webdav in winscp I’m not fimilar with that program yet. I use a program called bitvise to access my server. https://www.bitvise.com/ssh-client It has a ssh terminal as well.

The folders needed inside the user name.
Screenshot from 2024-06-12 08-25-07

I did SFTP transfer of all the clients files with the Nextcloud server stopped and client paused it worked.

I made some rough notes today but need to redo and make them step by step and to test again.

I did the following:
Paused sync on clients
Created folders /Restore/User for each user on the server.
Transferred all synced folders and files from each pc by SFTP
Changed ownership recursively to www-data.
Copied /Restore/User to /nextcloud/data/user/files for each user
ran occ files:scan --all
Turned sync back on for all clients.

All files have now been successfully restored and synced

Deleted /Restore/ folders

Cool. :sunglasses:
Did you shutdown the server while restoring files?

Nextcloud was in maintenance mode until the final sync.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.