General help

Moodle 3.1.5 database and moodledata clean up

Picture of William Stewart
Re: Moodle 3.1.5 database and moodledata clean up
Particularly helpful Moodlers


There are a few simple things you can do may make it smaller. I don't know how much, but consider at least the following:

1) Legacy Files

-These are from version 1.9 and earlier. In theory, you might have a lot of courses with tons of legacy files just taking up space. Many may not be used, others should indicate if they are linked to something. You'll want to delete the unlinked ones. There's no great way to do this except to review each course one by one. I was able to size down our Moodle installation by about 75% doing this. 

2) Unused Course Content

-Perhaps you can simply remove unused course content, scale down certain files like mp3's, large pdfs, ppts, etc., or host other media files (e.g., videos) on elsewhere (like YouTube or Google Drive) rather than inside of Moodle. 

3) Logstore

-This goes back to Moodle 2.7 I think, but in any case, it adds up over time. If you look in PHP myAdmin, you can see how big the log store table is. YOu can make a backup of this table or database for record keeping and purge the logstore. In my case, the logstore was about 90% of our database. I set it to keep records for 3 months versus indefinitely, and we keep a copy of our Moodle site as a whole at the end of every quarter for record keeping.

I'm confident others will have a lot more advice-the site I manage is very small but has been operating since 2007 ish.

Average of ratings: -
Picture of mihail pozarski
Re: Moodle 3.1.5 database and moodledata clean up


thanks for your fast answer.

I have the log store table set to keep records from 6 months, although it still uses 6gb of space its not a big deal for the infrastructure, the biggest problem i have are the files. But as there are 29312 courses and 6058805 files in the platform it would take to long if i started reviewing each course one by one. Please let me know if you come across a more massive way of doing this.

Once again thanks for your help!

Average of ratings: -