I am having backup problems, and was troubleshooting other issues earlier in the year, and my resolution at the semester was to export all the classes, create a clean database and reload the classes thereby getting rid of any cruft issues from a not-as-old-as-one-might-think Moodle setup.
The day started easily but I kept getting a nagging feeling that the classes were to large and found a mdl_log table in the database with entries from years ago and quite a large number of them. Apparently Moodle upgraded and did not remove the old log. So I used TRUNCATE and emptied the table. Of course I had researched the table and implications, backed up the database and so forth.
I then changed the log retention date to 2 days and ran cron repeatedly and was unable to trim the mdl_logstore_standard_log file at all and it was huge as well. I finally used TRUNCATE on that file as well.
I am a week along and the log files are running fine, no logs are appearing in the old table and I am hopeful the current logs are being pruned in accordance with the configuration.
I still haven’t resolved the backup issues and I am sure I have something else in the database and I pass on the obvious lesson that a Moodle site should be completely rebuilt annually, or on some regular schedule, to ensure that old data/tables are pruned or removed effectively.
If I could just resolve the backup stretching out as well as the backups in some, but not all, classes being retained I would have this system under control. Soon though.