MAJOR BACKUP ISSUE - Failure to complete backup of large courses
We are hosted by Host Gator and have been working for the past week to troubleshoot the issue. We have modified several variables (PHP variables) in our .htaccess files and several other modifications to change our PHP maximum time limits and memory limits. In the latest attempt, support at Host Gator modified our .htaccess file to reflect the following settings:
php_value max_execution_time 150
php_value max_input_time 200
php_value memory_limit 256M
We still aren't able to back-up the large courses and we don't know what to suggest to the support folks for test settings that might work - especially since our courses are continuing to get larger. Although nearly all of our approximately 75 courses backup just fine but we can't get these five to work. Since we are on a shared server, we also don't have access to the external zip/unzip path so that suggestion was not feasible. We are hoping that someone else with a combined knowledge of PHP, MySql and Moodle could help us out on this one.
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
We are having the same problem. Smaller courses are able to backup in 1.5, but larger courses are not. Is it a maximum backup size setting in the php/mysql database table that has to be adjusted?
We have installed Moodle v1.7 on a new server and I am trying to back-up the courses on the current Moodle v1.5 server.
The path setting was not the issue, as I have tried it with defining a path and allowing the default. If you have had any success, please let me know.
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
I am not on a shared host, so I can modify zip paths. I am on a MAX OSX and really don't know what I should do. Any suggestions?
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
HI All,
Is there any resolution to the backup and restore problem? We are running version 1.7 and we have SCOMRS which are quiet heavy and we receive a cgi timeout no matter how high we set all the possible options in php ini. Is there any way to manually copy the files there and make it work? We tried copying to moddata folder but the scorms dont show up.
Best Regards
Uday
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
We have several multimedia courses with huge amounts of large audio, flash, and video files that would not get backed up with the autobackup feature.
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
Hi Chris,
Thanks for the quick response. I tried by best to get this to work with your guidnace but I am not getting a CGI timeout error. I tried to fix a high time on the IIS cgi settings on windows XP but i am not sure whats is going wrong. Did you also change the settings in php.ini as well?
Best Regards
uday
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
Inside the moodle bacup folder there is a file called backup.php around line 112:
//Adjust some php variables to the execution of this script
@ini_set("max_execution_time","9000"); <--- I changed this from a lower number
raise_memory_limit("800M"); <--- I changed this from 128M for the courses with lots of multimedia files.
Same thing with restore.php at line 133:
//Adjust some php variables to the execution of this script
@ini_set("max_execution_time","9000");
raise_memory_limit("800M");
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

Before changing backup.php and restore.php, the restore process hangs after 2 minutes (more or less). Now, the restore process works 7-8 minutes withouth interruption and the course could be restore.
PD: the course have several Quizzes wiht 120 students and 5-6 attempts per quizz and student.
Pd: the restore process was very slow because appear a lot o errors like:
Notice: Undefined variable: match_ans in /www//moodle/question/type/match/questiontype.php on line 613
Could not recode answer in question_match_sub 8
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
I also noticed that moving questions around in quizzes and other things that alter the questions of a quiz will throw backup into a tizzy.
-Chris
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
I was having a similar problem:
- changed backup.php
- changed restore.php
Nothing worked until it deselected a database activity - then my backup worked. I have seen others indicating that non-standard moodle activities can be a problem.
My two cents worth.
Kevin
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
I'm having this backup problem as well but with 1.6.3
I get an error e-mail in response to my weekly automated backup schedule telling me that some courses were backed up and some not. If I go to those not and try to back up the process starts and then ends with what looks like an incomplete process (see attached picture). I tried changing the backup.php and restore.php files to increase the time and filesize settings but that didn't make a difference.
What does the reference to deselection of "database activity" refer to in the previous post by Kevin? I do have various non-standard Moodle mods installed...maybe they are causing the problem??
Any help will be appreciated.
Jason
P.S. I notice that it seems to stop at "quizzes" everytime in the courses that are failing to backup....could there be something in the quizzes that is causing the problem? I don't think I have anything abnormal installed there but I do have a ton of quizzes in the courses that are failing to backup....?
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
No solution yet to your problem? I am facing the same case. the thing is that the course i am trying to restore is 450MB and it only contains quizzes. I am unable to restore it. it is always halting though i increased the code files mentioned below (backup.php and restore.php)
hope its solved soon!
amer
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
Here is my course that I can't backup- all 12 megabytes of it. As you can see, all the activity is in the forums.
| Name: | ||||||||||||
| Backup Details: | ||||||||||||
Include Assignments with user data
|
||||||||||||
Include Choices with user data
|
||||||||||||
Include Forums with user data
|
||||||||||||
Include Glossaries with user data
|
||||||||||||
Include Hot Potatoes Quizzes with user data
|
||||||||||||
Include Journals with user data
|
||||||||||||
Include Labels with user data
|
||||||||||||
Include Lessons with user data
|
||||||||||||
Include Quizzes with user data
|
||||||||||||
Include Resources with user data
|
||||||||||||
Include SCORMs with user data
|
||||||||||||
Include Surveys with user data
|
||||||||||||
Include Wikis with user data
|
||||||||||||
Include Workshops with user data
|
||||||||||||
Include Chats with user data
|
||||||||||||
Include Course Users
|
||||||||||||
Include User Files
|
||||||||||||
Include Course Files
|
||||||||||||
and it always seems to hang on Forums
| Name: | backup-mgmt2006-20070930-1937.zip |
|
|
I have made the changes suggested in this thread to backup.php and php.ini without any luck. The backup.php script always seems to time out and I get a "Done" in the lower left hand corner of my Firefox window.
If I omit forum the backup goes through smoothly. Unfortunately, forums represent all of my student assignments and it is these forums that I desperately want to back up.
I am about to approach my host - www.bluehost.com. What should I be asking them?
Thanks
Simon
PS. Another course on the same server that is double the size (26MB) backs up OK but the difference is that it only has 210 forum posts as opposed to over 800 in this one.
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
I can manually run the cron script in some cases and most of the time the backup works then, but even so sometimes it stalls. Is this possibility related to memory or PHP memory limits in some way?
I have experienced this same problem on 1.5.3 and 1.6.3. I don't know if 1.6.4 has addressed these issues. 1.7 is not an option for us yet because we need a Score locking (AL) module and there are none for 1.7+ as of yet.
Thank you,
Eric
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
I my case the problem was fixed when :
1. I deleted all the test items
2. modified backup and restore .php files (128 to 500)
3. increased "maximal size of uploaded files"
I do not know the exact explanation !!!!
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
It seems that the quiz attempts burn up time and memory when the backup is being processed. I actually posted a bug about it...
http://tracker.moodle.org/browse/MDL-9838
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
I am facing a problem in courses which have quizzes and these quizzes were taken by many students 100 + students.
I am able to backup these courses but unable to restore them and the error message is saying that more memory required.
However, when i backup these courses without the quizzes, everything goes smooth.
Any solution or help?
I am backing up the course, deleting the original course, then restoring the course JUST to overcome the problem we have in moodle in the reset function.
PS: if you reset the course and then the same student takes the course, all his material will be present again in the course!!!So if the student failed the course once, he will keep failing it ALWAYS

regards,
amer
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
I had same issue in 1.5 and now in 1.8+
Jestin
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
Site Administration, Server, System Paths
I inserted /usr/bin/zip in the Path To Zip box for my Linux server. It solved my problem. I don't know what type of server you are using but you may want to talk to your administrator and see if you have zip path for your server.
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
Workaround was to disable the zip/unzip code in PHP. Just let Moodle copy your course into a backup folder and leave it at that.
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
Restore them one by one. First start a new course. With the other parts add to the course.
In one case I had to give up on restoring the quiz that was causing the problem and just restore the others.
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
Thanks for the tip but no luck. The forum is basically the only one of the Moodle modules I am using.
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
Hi I am running into this issue now too.
I am running Moodle 1.5.4 on a WIMP set up.
Due to a whole load of other issues, the only way I can upgrade my installation is by backing up every course and restoring them into a clean install of Moodle 1.5.4.
I came across problems backing them up at first, but overcame thos by not including course files for the troublesome courses and just copying them into the new course folder once it had restored.
However I am now having major problems with our Mathematics courses. Their backups are small (19MB compared to 600MB backups which have restored.), however these courses always hang when restoring the quiz modules. I have split the course back up into separate sections, but even with just the quizes on their own the still will not restore.
I have increased the settings in restore.php, backup.php and php.ini to 1024M and 3000 secs in all files to no avail!
Is the only option for me to tell the whole of our Maths department that have lost all of teh quiz results their students from 3 year groups have made this year? (900 students!)
If I can not get these courses to restore then we are stuck on Moodle 1.5.4, which does not meet the requirements the UK government are now pushing for VLEs!
Please help someone, so that I do not have to follow the governemnts recommendation and abandon Moodle for a closed source alternative!
Thanks....
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
I am also having the same problem. I tried changing backup.php, ignored database, most user data, and file, but again I am getting this message:
|
The backup did not complete successfully
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
Then zip has a file size limit of 2Gb.
I have as yet to find a way around this.
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
I found a solution by increasing php.ini max_execution_time to 60 secs, and in the Moodle config setting "Path to zip" and "Path to unzip" to use the OS's zip/unzip executables.
Im using a linux server with Moodle v1.9.2 and just the standard zip and unzip. On my system (Ubuntu) these are located in the "/usr/bin/" directory.
I understand that on a shared server you may not have access to these, however unless your hosting company is completely useless then a quick email to them might sort it out.
I just backed up a course with over 2gb of files inside it, the backup took a while but got there in the end. Resulting in a 1.5gb zip file that seems to unzip fine.
It might work for you too!
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
The course that is failing has 2.6gb of files inside it, so perhaps it is related to this?
Im going to have a scout around the net to see if I can uncover more on this issue, also I'll increase the max_execution_time to 90 just to try it.
If I fix it, I'll let you all know.
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
I have the same problem restoring a course in my 1.9 moodle hosted in bluehost.com, but if I install moodle in my computer using Windows packages I can restore it. I have increased all paremeters in php.ini and restore.php and restore fails again.
I have made a backup from my computer, without user data, and I can restore it in the moodle hosted in bluehost.com, but in the problem is not solved because when I have user data in the course, I am not sure that the backup works ok.
Jesus.
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
Thank you.
Jesus.
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
http://bugs.php.net/bug.php?id=27792
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
We also had the same problem about backup of a course having a lot of and/or large files as course file since PHP can not treat a file over 2.0GB.
Backup task will be failed in processes of generating zip file by using pclzip library and copying a generated zip file (in moodledata/temp/backup/uniqueid) to course file folder (moodledata/courseid/backup).
The problem that pclzip cannot generate a large zip file over 2.0GB can avoid by using a external zip program. On the other hand, the problem about retrieving backup zip file from temporary folder to course was not so easy.
We had resolved the second problem and reported it to tracker(MDL-18156) yesterday. Please read it and give me your comments.
Our solution concerning the constraint of PHP is very simple. We use rename() instead of copy() for retrieving generated zip file to course folder. Function copy() cannot treat a file over 2.0GB, but function rename() can treat it. In process of backup, we only need to move it, do not need to copy it! Coping a large file needs long time, but renaming it need a bit time.
Furthermore, if our solution is right, backup process at Moodle site will become so very light and speedy.
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
"Error checking backup file. moodle.xml not found at root level of zip file."
when I try to restore it. The biggest file I am able to restore is 2GB (I found this out by deleting files from within the backup zip file until it was just under 2GB).
I tried you hack but with no success. Any other ideas what the problem might be?
Thank you,
Mitchell
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
"Error checking backup file. moodle.xml not found at root level of zip file."
This error message will be displayed in function restore_precheck() including backup/restorelib.php,
if (!is_file($xml_file)) {
$errorstr = 'Error checking backup file. moodle.xml not found at root level of zip file.';
There are the codes after restoring target zip file by using function restore_unzip().
I guess that unzipping the backup file (*.zip) is fail, or copying the backup file to temporary backup dir by backup_copy_file().
PHP can not copy a large file over 2GB...
If we aim to resolve these problem perfectry, we need to eliminate all copy(), filesize() command, ant replace to original functions which use shell command via system() command...
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
Getting the same issue here and recieving major stick for it !!
We are running Moodle 1.9 on a MAC OS box. I have amended backup and restore files but its still not backing up large courses. Any advice would be greatly appreciated. I believe I have tried every suggestion on here !!
with thanks
Scott
Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses
so i added the following hack:
$forcebackup = optional_param( 'forcebackup' );
if ($forcebackup == '1') {
echo "<hr>forcing backup !<hr>";
backup_set_config("backup_sche_running","0");
}
to the backup php file and i start it from the url with "?forcebackup=1" parameter.
to make it continue where it was last crashed. and i come back to the computer
from time to time and check if it crashed and i have to run it again.
when i re-run the backup script it skips all the backed-up courses and so memory
limit always starts from fresh. after 5 or 6 re-submitting of the backup script it backs-up the entire system. it can take an hour or two (depending on the load)
i do it once a week. (for fun)
i also do an rsync of all moodledata folder tree and the backup of the entire DB which works smoothly and i recommend it too. see how to backup entire moodle site
more info:
http://tracker.moodle.org/browse/MDL-16082
http://tracker.moodle.org/browse/MDL-16510