Nextcloud manual file recovery

From Newroco Tech Docs
Revision as of 11:18, 11 April 2022 by Chris.puttick (talk | contribs) (Created page with "Where a user has deleted a large quantity of files, or has managed to move a large quantity of files to another place (or where the deleted files system has been pushed past o...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Where a user has deleted a large quantity of files, or has managed to move a large quantity of files to another place (or where the deleted files system has been pushed past operational condition by sheer quantity of deleted files) a manual recovery might be required. The same process can also be used for large-scale import of files from another store.

File recovery

Starting point: knowing where the files should be and where they currently are.

On the Nextcloud front end server, navigate to the Nextcloud storage directory. In smaller installations this is likely "data" under

/var/www/nextcloud/

but can also be outside the main Nextcloud directory. When not sure you can easily check with

grep data /var/www/nextcloud/config/config.php

(or wherever your installation's config.php file is stored) which should return a line like

'datadirectory' => '/var/myncstore/data'

. Once in the data directory you can either go straight to the location the files should be if you know the path (as you normally would if the files are in a user's area), or if it is in a group folder first determine the group folder's number using

sudo -u www-data php /var/www/nextcloud/occ groupfolder:list

(and groupfolders along with its trash folder) are under the directory __groupfolders



File import

Follow the steps as above, just need to also

  • copy the files in from the existing store using scp, rsync, wget or some other method as suits
  • check the file storage permissions and ownership match those of the rest of files before running the files:scan step.