Moosh is kinda like other plugins in that there are versions of it.
If running an older version of Moodle, one needs an older version of moosh.
Have a moosh for 3.5 installed, and when executing a moosh command inside moodle 3.9.highest with php version PHP 7.3.28 (cli), one might see something like:
PHP Deprecated: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in /root/moosh35/moosh/moosh.php on line 105
When it shows you a list of commands, at the top of that is moosh version.
What is the moosh version?
"... precisely how the mdl_files table relates to the filedir"
Basically, mdl_files table is a roadmap to files in moodledata/filedir/xx/yy/
contenthash column shows not only location in moodledata/filedir/xx/yy/ but the real filename in the system:
A bash shell script run from code/admin/cli/ that makes a command line query of DB/mdl_files table and outputs info to a files.txt file:
mysql -u $mddbuser -p$mddbpass -e "use $mddbname;select id,contenthash,filename,filearea,filesize from mdl_files;" > files.txt;cat files.txt
wc -l files.txt
Warning ... could be a very large files.txt file depending!
Example of one line in files.txt:
34139 a8e811cc11c77d950f774fa8973046aac43529ff backup-moodle2-course-3-mdlcli-20210403-1303-nu.mbz backup 40982949
The .mbz backup file shown above is in:
moodledata/filedir/a8/e8/ and is named:
It's humanly recognizable name (from meta data in mdl_files table) is:
Does that help?