We have a vendor course that was giving up difficulty backing it up. We have a content server where the 3rd party vendor uploads their courses. We then backup the course and restore to our production server. Most of the time, its straight forward.
The first problem was trying to create the backup. After a couple minutes we would get the second step of the backup process, but only partially, with no button to continue. When I viewed the php error log, i saw that a query had timed out.
I opened the php.ini file and scrolled to the Resource Limits section and made the following changes:
max_execution_time from 60 to 180
max_input_time from 60 to 180
Restarted apache and tried again.
I did not see any change in behavior, so I went back to the php.ini file and changed the values from
max_execution_time from 180 to 1000
max_input_time from 180 to 1000
Saved the file and restarted apache and tried again.
This time the backup presented the second step completely, so I could then interact with the course sections After turning off the sections I did not want in the backup (i was planning to do three backups for the course), I continued. I was then returned to the top of the form with a message saying "You must enter a valid filename for this backup" - I changed it to something short and tried again. I was greeted again with the message I tried a third time with the same result.... URRRRRRRRRR
After a little googling, I found this post in a moodle forum . It basically said that the backup file has more fields or variables than php is equipped to handle by default. The solution was to change the value for the php directive max_input_vars. No problem, I checked the value of the max_input_vars in the moodle instance where I was working Site Admin | Server | PHP Info - and saw the value of 1000, the default.
I switched back to the php.ini file to make the change to the directive, but could not find it in the file! I looked at least 3 times and then resorted to more googling to find out how i could change the value for the directive when it was not in the php.ini file. I found this post in my beloved stack overflow site...
I ended up adding the directive to the bottom of the php.ini file.
After saving the file and restarting apache again, I returned to my backup process and clicked continue and this time, it did not complain about a file name.....thank God. It continued normally and completed the backup.
Moral of the story? I do not know, but editing php.ini
max_input_vars = 5000
max_input_time = 1000
max_execution_time = 1000
was my golden ticket to dealing with the terribly bloated course.
Hi there,
ReplyDeleteI have been trying to backup a large course and have had no luck. I have tried the above settings and still nothing. Any assistance would be greatly appreciated.