Failed course backup - timed out?

Failed course backup - timed out?

by Andrew Field -
Number of replies: 5
Hi - we've got a course that I'm trying to backup with all user data but every time I try it fails to complete.

I've upgraded our Moodle to the latest 1.9.9 stable release and switched debugging on. Just tried to back the course up again and it stalls with the following:
    • line 2407 of backup/backuplib.php: call to debugging()
    • line 427 of backup/backuplib.php: call to backup_encode_absolute_links()
    • line 1117 of backup/backuplib.php: call to full_tag()
    • line 3052 of backup/backuplib.php: call to backup_course_sections()
    • line 60 of backup/backup_execute.html: call to backup_execute()
    • line 135 of backup/backup.php: call to include_once()
Writing users info. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . I think it might simply be too much for the server to handle. Any suggestions in this regard? Do I need to up any php settings or tweak something else?

The reason for backing up the course is that I want to split the students who use it - half of the students have now left so I have no need to keep their data (other than a backup) whereas the other half have one year left on their course. There are a significant number of students enrolled, but not a huge number - around 500. Each student has probably uploaded around 10mb of resources.

I did think it was a matter of file size, but when I exclude all user data, i.e. just backup the course files and details - it still fails with:
    • line 2407 of backup/backuplib.php: call to debugging()
    • line 427 of backup/backuplib.php: call to backup_encode_absolute_links()
    • line 1117 of backup/backuplib.php: call to full_tag()
    • line 3052 of backup/backuplib.php: call to backup_course_sections()
    • line 60 of backup/backup_execute.html: call to backup_execute()
    • line 135 of backup/backup.php: call to include_once()
Writing users info. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . .
The beloved 'continue' button never appears at the bottom sad
Average of ratings: -
In reply to Andrew Field

Re: Failed course backup - timed out?

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Hi Andrew - if the course is very big, have you thought about site administration>miscellaneous>experimental split restore? I quote: If enabled, course backup files will be checked for XML errors and split into smaller parts for use in the restore process. This will result in improvements to restore robustness and execution times, particularly for medium to large course backups

I am not sure this will help in your instance but anything is worth a try
In reply to Mary Cooch

Re: Failed course backup - timed out?

by Andrew Field -
Tried this one first - the course backup got further than it ever has before, but still errors. This time:

  • Writing users info. . . . . . . . . . . . . . . . . . . .
    . . . . . . . . . . . . . . . . . . . .
    . . . . . . . . . . . . . . . . . . . .
    . . . . . . . . . . . . . . . . .
  • Writing categories and questions
  • Writing scales info
  • Writing groups info
  • Writing groupings info
  • Writing groupings-groups info
  • Writing events info
  • Writing gradebook info
  • Writing modules info
    • Assignments
    MySQL server has gone away

    SELECT * FROM mdl_assignment WHERE id = '164'
    • line 686 of lib/dmllib.php: call to debugging()
    • line 481 of lib/dmllib.php: call to get_recordset_sql()
    • line 421 of lib/dmllib.php: call to get_record_sql()
    • line 49 of mod/assignment/backuplib.php: call to get_record()
    • line 2255 of backup/backuplib.php: call to assignment_backup_one_mod()
    • line 3285 of backup/backuplib.php: call to backup_module()
    • line 60 of backup/backup_execute.html: call to backup_execute()
    • line 135 of backup/backup.php: call to include_once()

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 57

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 59

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 60

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 61

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 62

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 63

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 64

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 65

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 66

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 67

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 68

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 69

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 70

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 71

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 72

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 73

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 74

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 75

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 77

    Notice: Trying to get property of non-object in /var/www/html/mod/assignment/backuplib.php on line 79

    Warning: require_once(/var/www/html/mod/assignment/type//assignment.class.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/html/mod/assignment/backuplib.php on line 79

In reply to Andrew Field

Re: Failed course backup - timed out?

by Colin Fraser -
Picture of Documentation writers Picture of Testers
Have you tried backing up a section at a time? Just backup part of the course, then another part and maybe a third part - depending how big it is. Be selective, and make sure you identify exactly what you are backing up in each part.

The reason I suggest this is that backing up can take a lot of resources, and if the resources are not available, then is going to spit the dummy at some stage. Should be OK, though.

It is possible there is something acting like a furball in an assignment or some such, causing the backup to choke. What should happen is if you have a smaller backup , it should work so you do the next part. If size has been the problem, then it will complete the sectional backup successfully. If it spits in the first part, but not the second, or vice-versa, then try and narrow what you are backing up, until you get a clear backup, then you have a good chance at finding what it is choking on.

The alternative is something has gone wrong in your backup pages. To save some time, you might want to FTP a new set of pages for the backup folder. That is, from your Test site, using FTP, delete your backup folder then just replace it with your test site folder. Be much quicker than downloading and updating. Or do this first, try it again, then if it repeats the behaviour, then you have lost nothing - but you have eliminated corruption of the code.

Of course, this takes time, and there may be a quicker way of doing this. If you backup parts of the course, then restore it later, just make sure you set the restore to add to the existing course.






In reply to Andrew Field

Re: Failed course backup - timed out?

by K K -
try to edit values in backup/backup.php:

" @ini_set("max_execution_time","3000");
raise_memory_limit("192M"); "
Set it to:
" @ini_set("max_execution_time","10000");
raise_memory_limit("512M"); "
Also you can try to change this values in your php.ini:
"max_execution_time" and "memory_limit".

And in the administration/server/Performance try to change "Extra PHP memory limit" from 128 to more values.
With best regards and sorry for my english.


In reply to K K

Re: Failed course backup - timed out?

by Andrew Field -
Thanks for the replies - I shall give both suggestions a try.