Here’s what happened…

  • Moodle 2.2.2
  • PHP 5.3.10
  • IIS 7.5
  • MS SQL 2008

We have a very large course with 31 topics, each Topic has at least 6 Book Resources and 4 or 5 Quizzes but may have as many as 22 Books and 18 Quizzes.
Overnight backups seem to work without reporting errors.
We have automated backup configured to include; users,  role assignments, activities, blocks, filters, comments, user completion information, logs, and histories.
But we are unable to run manual backups of this course.
We are unable restore overnight backups of this course if “Include enrolled users” is ticked on the “3. Setting” restore tab/page, it fails with the red “X.” Locked icon as described above.
But we can restore the overnight backups without “Include enrolled users” ticked.
When we try to manually backup the course it fails with red X next to items from about halfway through Topic 23 to the end, trying to proceed from this point gives the error “You must enter a valid filename for this backup” but the filename is the default generated, and changing file name doesn’t help.
Smaller courses don’t have any of these issues.
Debugging is turned on, but not trapping any errors.

After several hours debugging and searching I found the culprit, and the clue was “You must enter a valid filename for this backup” error message.
The manual back pages dynamically build/adding input form fields, so that you can select which topics/sections you want to include in the backup, and also so you can select to include user data for each section.
With this course there are 30 or more input form fields added to the page for each topic, plus form topic and section fields plus all the other visible and hidden form fields on the page.
And that’s what was causing the problem, PHP is configured by default to only accept 1000 values (max_input_vars=1000), and the backup page had well over 1000 form fields.
The “You must enter a valid filename for this backup” error message was being generated because now value was posted back for the form field that should have contained the filename, simple really…
Setting max_input_vars to  5000 (max_input_vars = 5000) in PHP.INI fixes this issue.

Hope this helps someone out there…