I mistakenly deleted about 30k files in a folder which I had synced to Nextcloud.
How can I restore an older version of this folder from Nextcloud?
In the folder itself I have not found any option to go back to an older version as I have seen this for files.
I have found the “deleted files” section, but there is no way to restore the whole folder (probably because all the files got deleted separately).
It looks there is no way to filter files by any conditions and it would be a bit inconvenient to manually check and restore 30k files.
Any ideas to get this folder restored from Nextcloud?
Nextcloud has got a trash (documentation). Files can be restored from it.
Are the files still in the trash bin? If so, and if there are a lot of them, you may be able to select and restore all of them. If the trash bin has been emptied, then all you have left is a backup copy of your Nextcloud. Do you have a backup copy of the files? If so, you can copy them back with cp
or rsync
, for example, and make them known to Nextcloud again with sudo -u www-data php occ files:scan --all
(documentation).
Backup and Restore describes the complete backup and restore of Nextcloud. You only need a part of it.
Yes they are there, but I cannot check manually 30k files there to restore them:
Is there not the checkbox for “select all”? But i think that does not work.
Can you find the files in your file system e.g.
/path/to/nextcloud/data/<username>/files_trashbin/files
0.) make a backup of your Nextcloud
then
a.) make a download and upload again mit Nextcloud functions
or
b.) move (mv
) files to /path/to/nextcloud/data/<username>/files
sudo -u www-data php /path/to/nextcloud/occ files:scan --all
Bear in mind that any shares in the deleted files may be lost.
Yes there is, but I don’t want to restore all files from the trash, only from a certain folder.
This folder contains all files, but not stuctured by folders and all the files got a postfix at their names.
I guess you mean to restore a full-backup from the Nextcloud instance.
In this case I would have to do that on another server, since there are multiple users on it.
I am wondering that there is not easy way for users to restore a whole folder if many files got deleted mistakenly.
I find in my trash bin directories and i can recover them. The suffix is also displayed directly in the Nextcloud GUI. I didn’t notice it before, it has been changed or it is a bug.
I have there directories shown as well, but not for these files,
Those suffix are shown in my webinterface as well, I also did not notice them before.