Assignments deleted - revert

Re: Assignments deleted - revert

by Davo Smith -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

There isn't really a good way to recover deleted files. Your best bet would be to recover the file from a recent backup (if you have one).

When a file is deleted, the record of it is deleted from the mdl_files table.

The file on the disk is not deleted immediately, it is deleted after a day or so. You may find the file inside [moodledata]/trashdir/filestorage (this can be overridden if you've set $CFG->trashdir on your site). The file will be named based on a hash of the content of the file, so all the files in this trash directory will be named something like: a0/b8/a0b8e8a9bc2abc132... If there are a lot of files, you will have to open each one in turn (assuming your OS can properly handle files without extensions) to figure out which one it is.

Note, if the same file has been uploaded elsewhere on the site, then the file will not be in trashdir, as there will still be a 'live' copy of that file.