MAJOR BACKUP ISSUE - Failure to complete backup of large courses

MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Rich Schumaker בתאריך
מספר תגובות: 37
At the end of the last session, we began to have problems with a few of our course backups on our 1.5.4 version of Moodle. We were hoping the upgrade we made to 1.7 would fix the problem but we still have five courses that we can't get to back up and we think its a php or mysql problem. They all either have a large number of students (900+) or large course sizes and something is timing out before the backup completes. We have been able to do the backups as long as we don't include the users or logs. There is a forum post ( http://moodle.org/mod/forum/discuss.php?d=61482#278393) from some other users who are experiencing the same problem but no one has posted a solution yet.

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.
ממוצע דרוגים: -
בתגובה ל: Rich Schumaker

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Cathy Maher בתאריך
Hi Rich,

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.
בתגובה ל: Rich Schumaker

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Chris Kenniburg בתאריך
תמונה של Plugin developers
I am having the same issue. I had a course with 250MB of WAV files and it would get an error every time.

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?
בתגובה ל: Chris Kenniburg

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי uday ramakrishna בתאריך

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

בתגובה ל: Rich Schumaker

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Chris Kenniburg בתאריך
תמונה של Plugin developers
I was able to fix my problem by editing the Backup and Restore PHP files in moodle. The default memory limit is 128MB in the php code. I changed that to 500MB and all is fine now. Both settings were near the bottom of backup.php and restore.php.

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.


בתגובה ל: Chris Kenniburg

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי uday ramakrishna בתאריך

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

בתגובה ל: uday ramakrishna

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Chris Kenniburg בתאריך
תמונה של Plugin developers
Hey Uday,
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");

בתגובה ל: Chris Kenniburg

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Giles Greenway בתאריך
I've tried this, and also played with max_execution_time in php.ini. My host limits the ram to 4Mb, and the max input time is 15s. -Are these a deal-breaker for getting my courses to zip properly? One course is only about 11Mb. If I wanted to grab and zip the files by hand, where would I need to look and how could I put them back?
בתגובה ל: Chris Kenniburg

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Juan Marín בתאריך
It works for me!!!!!!!big grin

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
בתגובה ל: Juan Marín

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Chris Kenniburg בתאריך
תמונה של Plugin developers
Even with my backup and restore suggestions above, I still had several courses not backing up. I found that doing a course reset and removing all students and data worked. One course had a quiz with over 300 attempts and several hundred students who were no longer even in that grade. By completely removing all the data from the course, backup is now working well. No courses failing.

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
בתגובה ל: Rich Schumaker

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Kevin Freeborn בתאריך

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

בתגובה ל: Kevin Freeborn

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Jason Hollowell בתאריך
Hello,

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....?
צרופה bckup.jpg
בתגובה ל: Jason Hollowell

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי A. H. בתאריך
Hello Jason,
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
בתגובה ל: Jason Hollowell

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Simon Fraser בתאריך
I just started the semester and already I am having problems backing up.

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
Assignments 0
Submissions 0
Include Choices with user data
Choices 0
Responses 0
Include Forums with user data
Forums 13
Subscriptions 433
Discussions 246
Posts 811
Ratings 262
Include Glossaries with user data
Glossaries 0
Concepts 0
Include Hot Potatoes Quizzes with user data
Hot Potatoes Quizzes 0
Attempts 0
Include Journals with user data
Journals 0
Entries 0
Include Labels with user data
Labels 0
Include Lessons with user data
Lessons 0
Attempts 0
Include Quizzes with user data
Quizzes 0
Categories 0
Questions 0
Grades 0
Include Resources with user data
Resources 92
Include SCORMs with user data
SCORMs 0
Scoes 0
Include Surveys with user data
Surveys 0
Answers 0
Include Wikis with user data
Wikis 0
Include Workshops with user data
Workshops 0
Submissions 0
Include Chats with user data
Chats 0
Messages 0

Include Course Users
Users 237
Include User Files
Files 155
Include Course Files
Files 16


and it always seems to hang on Forums
Name: backup-mgmt2006-20070930-1937.zip
  • Creating temporary structures
  • Deleting old data
  • Creating XML file
    • Writing header
    • Writing general info
    • Writing course data
      • Course info
      • Metacourse
      • Blocks
      • Sections
    • Writing users info. . . . . . . . . . . . . . . . . . . .
      . . .
    • Writing categories and questions
    • Writing scales info
    • Writing groups info
    • Writing events info
    • Writing gradebook info
    • Writing modules info
      • Assignments
      • Choices
      • Forums


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.
בתגובה ל: Rich Schumaker

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Eric Eberhardt בתאריך
I am having this problem as well. It is a serious issue and any insight would be great. The cron seems to run fine, but when the backup routine starts, the cron stops functioning after that. I've tried using MoodleCron, task scheduler, and wget methods and all have the same results.

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
בתגובה ל: Eric Eberhardt

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Abdelkrim Jebbour בתאריך
Hi everybody,

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 !!!!
בתגובה ל: Rich Schumaker

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Howard Miller בתאריך
תמונה של Core developers תמונה של Documentation writers תמונה של Particularly helpful Moodlers תמונה של Peer reviewers תמונה של Plugin developers
I had a very similar problem. It turned out to be quiz attempts. If you have active quizzes then you can confirm this by turning off user data (ie, the attempts) just for quizzes.

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
בתגובה ל: Howard Miller

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי A. H. בתאריך
Hi Howard,

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 surprise

regards,
amer
בתגובה ל: A. H.

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Jestin VanScoyoc בתאריך
I too have backup issues that hang on quizzes. I manually backup course w/o quizzes and then do a separate backup of just the quizzes for the course. A bit of a pain, but it works for me. My total course size was less than 6MB even with quizzes.

I had same issue in 1.5 and now in 1.8+

Jestin
בתגובה ל: Jestin VanScoyoc

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Rich Schumaker בתאריך
I had a similar problem and I started using the server zip path instead of Moodle's. Under 1.7 go to:

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.
בתגובה ל: Rich Schumaker

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Ben Steeples בתאריך
I encountered this when restoring courses that were 600MB or so in size.

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.
בתגובה ל: Ben Steeples

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Bob Gettings בתאריך
I was able to get around it by backing up the course in sections. Try backing up the course without the forums or quizzes that are giving you problems and then back up the course again with only the forums or or quizzes or half the forums.

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.
בתגובה ל: Bob Gettings

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Simon Fraser בתאריך
Hi Bob,

Thanks for the tip but no luck. The forum is basically the only one of the Moodle modules I am using.

בתגובה ל: Simon Fraser

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Jon Witts בתאריך

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....

בתגובה ל: Jon Witts

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Ismail Fayed בתאריך

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:

  • Creating temporary structures
  • Deleting old data
  • Creating XML file
    • Writing header
    • Writing general info
    • Writing course data
      • Course info
        An error occurred while backing up course start

      • Blocks
      • Sections
    • Course format data


The backup did not complete successfully

Could anybody help???
Thanks.
בתגובה ל: Ismail Fayed

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Martin Stevens בתאריך
One of the issues I have noticed here, is if a course is over 2Gb, which is easily possible.

Then zip has a file size limit of 2Gb.

I have as yet to find a way around this.
בתגובה ל: Rich Schumaker

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Dale Davies בתאריך
תמונה של Plugin developers
Not sure if I can help here, its been a while since the first post! I have been having the same problem that you have (or had).

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! חיוך
בתגובה ל: Dale Davies

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Dale Davies בתאריך
תמונה של Plugin developers
OK, 4 out of 5 errors were fixed by that! I still get one where the backup fails whilst copying the zip file. The others failed when creating the Zip.

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.
בתגובה ל: Dale Davies

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Jesus Picornell Alsina בתאריך
Hello everybody.
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.
בתגובה ל: Jesus Picornell Alsina

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Jesus Picornell Alsina בתאריך
Hello, I have changed the PHP configuration using cPanel in my web server (bluehost.com), now I am using PHP5 FastCGI and I can restore de course without problem.


Thank you.


Jesus.
בתגובה ל: Rich Schumaker

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Dale Davies בתאריך
תמונה של Plugin developers
OK, so I cant find a solution. Could the problem be related to this....

http://bugs.php.net/bug.php?id=27792

בתגובה ל: Dale Davies

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Tatsuya Shirai בתאריך

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.

בתגובה ל: Tatsuya Shirai

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Mitchell Kennard בתאריך
I know this is an old thread but I am having a similar problem. I am using external zip/unzip binaries on a Windows machine. I am trying to backup a 3.5 GB course. I can zip it with no problem but get the error:

"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

בתגובה ל: Mitchell Kennard

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Tatsuya Shirai בתאריך
Hi, Mitchell.

"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 (! $status = restore_check_moodle_file ($xml_file)) {
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...
בתגובה ל: Rich Schumaker

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Dean Thayer בתאריך
I found that the gallery module would reset the php_value max_execution_time value to a smaller value than I had defined in /etc/php.ini. I added "disable_functions = set_time_limit" to /etc/php.ini to prevent gallery or any other module from overriding the value I had set in /etc/php.ini.
בתגובה ל: Rich Schumaker

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Scott Cotterell בתאריך

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

בתגובה ל: Scott Cotterell

Re: MAJOR BACKUP ISSUE - Failure to complete backup of large courses

על ידי Nadav Kavalerchik בתאריך
תמונה של Core developers תמונה של Plugin developers תמונה של Testers תמונה של Translators
i am having the same issues over here with 300+ courses site (big courses lots of multimedia files)
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