Quantcast
Channel: Installing and upgrading help
Viewing all articles
Browse latest Browse all 46779

Re: Manually finding and deleting orphaned files (M2.2+)

$
0
0
by Ken Task.  

In the output of your search of mdl_files table, there is a column called 'contenthash'.  Data looks like: 5839e1df9296d0bce3bde8dc7f275d377ca7c547

In this example, the humanly recognizable file is called ' STAAR_Chemistry_Chart_1_.pdf'  but on will not see that file by that name.

cd moodledata/filedir/

cd 58 (first two characters of the contenthash output)

cd 39 (second two characters of the contenthash output)

Inside moodledata/filedir/58/39/ one will see a file by the name of:

5839e1df9296d0bce3bde8dc7f275d377ca7c547

It is the PDF file provided in the example:

[root@www 39]# file -b 5839e1df9296d0bce3bde8dc7f275d377ca7c547
PDF document, version 1.6

There is no file called orphaned.   It is also advisable to avoid manually changing anything in filedir as it's contents is (as example shows) tied to the mdl_files table of the Moodle DB, but sometimes it might become necessary.   Do so with caution.   And make sure you backup your moodledata directory before embarking on such an endeavor ... just in case one errors.

Several discussions and resources related to orphaned files:

http://bit.ly/1iPaIGb

First link in above search of Google:

https://moodle.org/mod/forum/discuss.php?d=200401

'spirit of sharing', Ken


Viewing all articles
Browse latest Browse all 46779

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>