Quantcast
Channel: Backup and restore
Viewing all articles
Browse latest Browse all 6815

Re: Excluding Large Files When Copying a Course and Referencing Original Files

$
0
0
by Gloria C.  

Thanks Ken, for your reply.

I’ve discovered that when Moodle copies a course, it does not actually duplicate the file itself. Instead, what happens in the mdl_files table is:

New Record Creation: A new record is created for the file, using the same `contenthash` but a different `pathnamehash`.

Contenthash vs. Pathnamehash:

Contenthash: This identifies the file’s content location. If the contenthash is different, it means a new file is created. If it’s the same, the file is reused.


Pathnamehash: This is an encrypted string based on

"/$contextid/$component/$filearea/$itemid".$filepath.$filename

. It essentially represents where the file is displayed within the Moodle context.

So, even though the course is copied, the physical file remains the same. The pathnamehash is what determines how and where the file is displayed in the new course context.

This explains why my issue was resolved.


Viewing all articles
Browse latest Browse all 6815

Trending Articles



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