Support intro
Nextcloud version (eg, 20.0.5) : 20.0.12
Operating system and version (eg, Ubuntu 20.04) : Debian 10
Apache or nginx version (eg, Apache 2.4.25) : 2.4.38
PHP version (eg, 7.4) : 3.3.29
The issue you are facing:
A user deleted a lot of files. We would like to restore them without using the web UI. The initial plan was to move them in the file system, use files:scan then delete the oc_files_trash rows for the files.
However, this creates a bunch of new files and breaks links and history.
Is there some PHP internal code that can be called to do this, given a list of file IDs or paths? Some other way? Or can we do the above, then update the IDs in oc_files_cache (which seems quite dangerous).
Any suggestions welcome!
wwe
January 2, 2022, 7:57pm
2
I’m not aware of such functionality as of now so I added this 2 issues shortly:
opened 01:09PM - 03 Dec 21 UTC
enhancement
feature: filesystem
0. Needs triage
feature: files
feature: versions
feature: trashbin
feature: occ
### How to use GitHub
* Please use the 👍 [reaction](https://blog.github.com/2… 016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to show that you are interested into the same feature.
* Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
* Subscribe to receive notifications on status change and new comments.
**Is your feature request related to a problem? Please describe.**
often there are sync issues when desktop client removes or changes lot of files by mistake e.g.
[desktop client #4016](https://github.com/nextcloud/desktop/issues/4016)
[desktop client #4035](https://github.com/nextcloud/desktop/issues/4035)
[desktop client #3444](https://github.com/nextcloud/desktop/issues/3444)
As the sync is pretty fast and the error might be not obvious, this results in hundreds or thousands of deleted files or files existing as different versions.
**Describe the solution you'd like**
Please add a possibility to manage this files from command line e.g. occ or other tool which allows user to perform mass recovery of files (and remove invalid file versions) after such issue.
Good starting point would be the server activity history where the user could review changed files and "*undo*" the action like restore previous version and delete new one or restore deleted files..
**Describe alternatives you've considered**
If the problem affects multiple files in different folders the only alternative seems to be a server restore. as manual versions handling is impossible for more than couple of files..
opened 08:15AM - 14 Dec 21 UTC
enhancement
0. Needs triage
### How to use GitHub
* Please use the 👍 [reaction](https://blog.github.com/2… 016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to show that you are interested into the same feature.
* Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
* Subscribe to receive notifications on status change and new comments.
**Is your feature request related to a problem? Please describe.**
Allow to recover the state of your files at specific day in the past.
**Describe the solution you'd like**
motivated by this [excellent post](https://www.linkedin.com/pulse/wannacry-lieber-nicht-philip-b%25C3%25BCchler) around M365/Onedrive file restore feature I would appreciate similar functionality could be added to Nextcloud.
A user should have an option to restore all files from trashbin and versions at specific point in time (definable by admin 30d is good default) to recover from malware attack (files deleted/encrypted) or some logic problem or user fault e.g.
https://github.com/nextcloud/desktop/issues/3444
https://github.com/nextcloud/desktop/issues/4016
**Describe alternatives you've considered**
At the moment there are two options: recover all files one by one from trashbin and versions which doesn't work for many files and a restore which is complex and might require admin interaction, additionally depending on the backup strategy it might be impossible to restore only the files of a single user.
related to #30074 which requests more flexible but admin-related approach.
**Additional context**
Example from Onedrive:
![image](https://user-images.githubusercontent.com/18125597/145956652-40cf61b1-6a31-44b2-b54a-7e1b50ef4958.png)
please like and keep checking them for the solution. Short term I think best is to let the user recover files using UI. I had to restore hundreds of files in the past (deleted by the sync within short period) and it was good enough - maybe 5 min/100 Files