iBlog

Trevor Johnson
posts - 6 , comments - 12 , trackbacks - 0

My Links

News

Archives

Moodle 2.2.2 Backup Issue

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…

Print | posted on Friday, May 4, 2012 2:10 PM |

Feedback

Gravatar

# re: Moodle 2.2.2 Backup Issue

Hi Trevor,

Thanks for your article. Sadly I am facing the same problem. I have a massive course with a lot of resources and activities. I tried finding the max_input_vars in the php-info and saw that it wasn't included. The loaded php.ini didn't have it configured either. Upon noticing this I added the line to the php.ini and restarted the webserver.

Sadly this did not solve my problem and there are definitely not more than 5000 form items in this form. Could there be another cultprit?
6/14/2012 9:54 PM | Virgil Ashruf
Gravatar

# re: Moodle 2.2.2 Backup Issue

Hi Virgil

Did you try a larger value just to rule it out?
Are you getting an error message (have you got debugging enabled)?
6/15/2012 7:33 AM | TJ
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: