Howto restore permanently deleted files from rsync backup

Hi,
i have simple rsync backup for data directory files ( BackupPC: Open Source Backup to disk ) to external server . i can restore files back to users directory, but they doesn’t show up because NC database is not updated.

So question is, how are you doing backup/restore for user data files ?

For e.g. user delete some folder + also removes it from “Deleted Files” permanently. Can i restore files and run some occ command to scan that folder information to the database ?

Check this out Occ path for rescan lokal external share - #2 by gas85

Or use key --all if you restore whole data directory.

Documentation is under https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#scan

Thank you gas85 for link, files now show up in user GUI.

So basically after file restore i just run:

root@files:/var/www/nextcloud# sudo -u www-data php /var/www/nextcloud/occ files:scan --path="user@domain.com/files/Other"

1 Like