Moodle 3.6 Log Problems

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.

Moodle Automated Backup Problems

I am back to troubleshooting, yet again, the problem of Moodle backups taking forever and a day. An actual day, for very small courses.

A second problem occurring with the automated backups is that the old backups are not being purged so the file system is filling up with them rather than purging/pruning them. I am solving the problem at present by a weekly manual clean up.

I could simply pour over the forums for an answer, which has not produced results. I could look at tables/records in the actual database for anomalies and that strikes me as time consuming. Or I could wait until the semester break in two weeks and backup and export each class and all the information and create a brand new instance of Moodle and restore the classes into that and see if that leaves the cruft and problems behind.

I am going with that alternative in the interests of cleaning up any other problems I am not yet aware of that affect other areas including performance.

Will post my results.

Packt’s Moodle Books

This spring I reviewed the Packt publishing book Moodle 3 E-Learning Course Development – Fourth Edition

Within a week after it being published I had already recommended it for a teacher/consultant to use it to setup there online training course in support of their book/program.  Take a look it is pretty great.

I have just finished reviewing another Moodle book for Packt which should be officially published soon.

Replacing Surname with Last Name in Moodle 3.1.1+

This is a post recommending utilizing Moodle menus as opposed to writing your own code.  If you prefer to customize your site in a manner that upgrading becomes nigh on impossible, please, do so without leaving a comment or reading further.

New accountI had an amusing time reading the posts of folks who have hacked the PHP code, and brilliantly, they really can code elegantly, in various places to modify the sign in screen to replace “Surname” which is English (think across the water in either direction) with “Last Name” which is the US English version of what is required in that field.  Some of these hacks were worth seeing just to learn how simply one can change a great deal of code.  In addition, they were accurate and changed with various versions of Moodle. 

HOWEVER, for all of the versions I read there was also an answer in the Moodle documentation.  Maybe it is that the answer references Language Packs and that deters folks.  I will argue that making a change that uses Moodle in a standard format does make updating much easier and straightforward, and well, as you might imagine, also fixes other language issues.

If you are running a US site, in version 3.1.1+ (the documentation references v2.7 on)  one simply goes to Site Administration –> Language –> Language packs and installs the EN_US version of English and then sets it as the site default …

Today’s Lesson

error/invalidrestorefile Errors Trying to Restore a Course in Moodle

I am running Moodle 3.1 (Build: 20160609); however, none of that matters.  I had errors restoring files as I reset my system for the next academic year which I do immediately before they send me packing for the summer season. 

I got it to work last Friday but on Monday decided to start again from scratch and ran into the problem again and the forums simply didn’t help me.

Both last Friday and Monday, with a fresh install and database I had the eror ‘error/invalidrestorefile’ crop up when attempting to restore backups files from a Server File Repository I had created on the server.  I tried all the suggestions in the folder, but so many seemed to end with “that fixed it” when the resolution should not have.  

The trick to solving this is to see the patterns in the postings on http://moodle.org.  Most “magically” solved the problem and couldn’t really give developers any explanation.

It doesn’t restore from the respository, not with “Import a backup file”, it appears to run into the 2MB limit and yet returns ‘error/invalidfilerestore’.  I did grin at the person who deleted PDFs, delete what you will, when you are under 2MB it works.   UNLESS, you simply waltz into the Front Page Restore and ADD the file to the backup location.  Yup, on the page below I was selecting the “Import a backup file” location when I needed to click on “Manage course backup area” [it also works in “User private backup area”], then select the Moodle “copy” to copy the file from the Repository to the appropriate backup area and THEN it restores just fine.

Whew!  Somedays I should have more coffee and click less.

Moodle File Restore