Moodle 2.x Failing Course Restores


I’ve been wrestling with a course restore problem on Moodle 2.4.2 and Moodle 2.5. Basically you can take a course backup fine, but when trying to restore it, it will timeout, and fail to restore the course at all or may only restore a small segment of it. Of course it fails, with no entries in the log files, moodle and PHP debug logs or anywhere else. The only error that can be found is: Timeout.

I resolved it in the end, it turns out it was down to the platform I was using, we are a Microsoft shop and so want to stay with as much Windows and Microsoft as we can to reduce support costs.

We’ve setup two new moodle 2.x platforms for our migration from Moodle 1.9 as follows:

Moodle 2.4.2 or Moodle 2.5 Platform

Microsoft Windows 2008 Server R2 SP1

Microsoft IIS 7.5

Microsoft SQL Server 2008 R2

PHP 5.4.9

Moodle 2.x is said to be supported with Microsoft SQL 2005 only, but you’ll find it works okay on 2005, 2008 and 2008 R2, but you’ll find that you’ll get some odd errors from time to time and there’s some workarounds you might need in place, but overall it works.

The big problem we had was the course restore FAIL, backups from 1.9 and even itself 2.4.2 or 2.5 would fail if they were over 20MB in size, with a strange timeout.


I have found a solution, it turns out it appears to be a problem with Microsoft SQL, we reinstalled Moodle 2.4.2 and Moodle 2.5 onto the same web server and a new web server with the same IIS, PHP etc. versions, but this time used MySQL for the Moodle database. boom, problem fixed. It was that simple.

I’ve tested using Microsoft SQL 2005 RTM, SP1, SP2 and SP3 and Microsoft SQL 2008 R2 RTM and SP1, with Moodle 2.4.2 and 2.5 both give the same problems, they do not restore courses from Moodle 1.9 or more worryingly from Moodle 2.4.2 or 2.5 (even restoring to itself doesn’t work.)

I’ve therefore concluded that although MSSQL works with Moodle and its claimed it is supported on MSSQL 2005, this bug that affects even the latest version seems to be an incompatibility with MSSQL, not the first I’ve found but there only one that is not fixable or cannot be worked around. Ideally we’d use MSSQL but, it appears the compatibility with Moodle for this might be a little way off yet.

We do now have a stable platform which is operating with no errors and we can successfully perform course restores from 1.9, 2.4.2 and 2.5 up to 300MB size (we’ve not tested higher yet), here are the details:

Moodle 2.5 (or Moodle 2.4.2)

Microsoft Windows 2008 R2 Server Standard SP1

IIS 7.5

PHP 5.4.9

MySQL 5.5.32 (64-bit)

Therefore I recommend that you use the above platform and versions for Moodle 2.4.2 or 2.5 as it appears to be stable, and that you don’t use Microsoft SQL Server with Moodle as the computability just isn’t there yet.