Course Backup Problem

Course Backup Problem

by rui gomes -
Number of replies: 20
Hello,

I can make backups of the courses but not of the all class, dont give any particular error, when i try to do this it get back to the selection section of the course i want to backup.

How can this be fixed?


Regards,


Average of ratings: -
In reply to rui gomes

Re: Course Backup Problem

by Gavin Henrick -
Picture of Plugin developers
What version of moodle have you installed?

If you go through clicking on / off each options when trying a backup, starting one that goes through to completion, you will isolate which section is breaking.

We have seen issues with backups on vanilla and modified moodles, often related to the size of the file and max file settings on server/moodle itself.

Gavin.
In reply to Gavin Henrick

Re: Course Backup Problem

by rui gomes -
Ok, if i disable assignments and user data the backup works.

Any idea how i can solve this?

Regards,


In reply to rui gomes

Re: Course Backup Problem

by Gavin Henrick -
Picture of Plugin developers
if you got "just" assignments does it fail?
if you got "just" user data does it fail?

what moodle version is it?

Gut feeling is the file size issue, how big is the backup thats working, how big is the setting for max upload file on the course/site/webserver..

In reply to Gavin Henrick

Re: Course Backup Problem

by rui gomes -
Hello,

The only place i see the max upload size it says 47MB, but this is for files uploads, right? Has nothing to do with backups.

My moodle version is 18+ (2007021505)

if you got "just" assignments does it fail?
if you got "just" user data does it fail?

If i select to much fiels from them it will fail, but if i select only a few it works.

Regards,


In reply to rui gomes

Re: Course Backup Problem

by rui gomes -
Can someone help me out on this issue?

Regards,
In reply to rui gomes

Re: Course Backup Problem

by rui gomes -
Im sorry to insist but im really needing some help here, no one with similar problems or ideas how to solve it?

Regards,

In reply to rui gomes

Re: Course Backup Problem

by Gavin Henrick -
Picture of Plugin developers
From my understanding, the max file size does effect backups, as it effects the size of file moodle creates. So if your file is going beyond that, you can see when it works and when it doesnt.

Ramp your max file way up (needs to be done in php/apache/moodle) and try again.

Is your file near this size when it works and when you add more data, fails?

In reply to Gavin Henrick

Re: Course Backup Problem

by rui gomes -
You mean that the max file size must be changed at the server (apache). I tried that and put it to 400M and we couldnt make the backup.

If i add to much data to the backup process it fails.

When you mention file size this cant be done on moodle i have to request it to our hosting provider, right?

Regards,


In reply to rui gomes

Re: Course Backup Problem

by John White -
Rui,

(Barging in, sorry) I'm less than convinced that max file size affects backups!
There would be no logic in that. If you had it set to 12MB and uploaded 2 x 10MB video clips, next day's backup would have to fail!

Also in a site where we had 25 x 10MB videos, I had to remove videos (course files) from the backup settings
because in 3 days we hit a 1GB limit on the server; plainly not constrained by the 12MB limit!!!

However, it is possible that you are being foxed by cPanel statistics.
The front page of cPanel (depending on the settings) may give you a lovely display that suggests that you have loads of space left because it only counts public_html!
If you click Disk Space Usage perhaps you will find that you just don't have any room for these backups! Simply that.

So maybe you need more space, or maybe instead of including giant videos etc. in the rolling backup, producing multiple copies of something that never changes, you keep ONE copy on an entirely separate system (e.g. your local pc) and exclude them from the backup.

However, there is another limit you could well be hitting...
Look in public_html/backup/backup.php (open this ONLY in a proper PHP/HTML editor).
Find the lines:

//Adjust some php variables to the execution of this script
@ini_set("max_execution_time","3000");
raise_memory_limit("192M");

Evidently when run it creates its own file size limit and time-out on the fly.
If you really must backup so much, and you do have loads of space to do so, push these up.

Once you've resolved these issues you can even use backup ONCE to backup course files ONLY, and then port the backup off elsewhere to regain the space.

BTW on a shared server, yes your ISP probably has an .htaccess file (or maybe some php.ini) that constrains the ceiling of max file size.

Regards,

John
In reply to John White

Re: Course Backup Problem

by rui gomes -
First of all i would like to thank your intervention,

Im sorry to say that none of the options presented worked.

About the disk space usage i have confirmed that im using:

1470.54 Meg

and i have an hosting account with 60000 MB

So it cant be the origin of this issue.

About the limits:

//Adjust some php variables to the execution of this script
@ini_set("max_execution_time","3000");
raise_memory_limit("192M");

I have changed it to:

//Adjust some php variables to the execution of this script
@ini_set("max_execution_time","12000");
raise_memory_limit("512M");

It didnt work either.

Really cant figure this out.

Regards,

In reply to rui gomes

Re: Course Backup Problem

by John White -
Well I thought those might be worth a try!

I'm sure that Gavin was right in trying to get you to narrow down how much data triggers the failure.

Also, I don't think you have anywhere posted the exact error you get.
Posting the exact wording may help.

Also I could be making a mistake. Confusing the effect of maxbytes and max_file_size. I am sure that the first of these is not related to the problem.
Maybe Gavin is right about the second.

You should test repeatedly to find out the maximum size of backup file that it can do, so as to see when it fails.

Regards,

John
In reply to John White

Re: Course Backup Problem

by rui gomes -
The main problem is that even with debug i dont get any error, in spite of appearing the screen with the backup file to choose it returns to the course selection.

Regards,


In reply to rui gomes

Re: Course Backup Problem

by John White -
Rui,

You mean that the backup file appears as if completed???

Have you used your ftp client to look at the size of the file created?

- John
In reply to John White

Re: Course Backup Problem

by rui gomes -
After running the cron Job it seems that backup files are added to the course folders, but if we try to go directly to the course and initiate the backup process it is to much quick and go directly to courses list without doing anything.

Regards,
In reply to rui gomes

Re: Course Backup Problem

by John White -
Rui,

Now look in...
Site Administration->Courses->Backups

and compare the list of items than the cron automatic backup includes, with the list of items you are trying to backup when you backup from inside the courses.

They MUST be different, what are the differences???

This MUST be one of three things:
1. A size restriction - somewhere
2. A time-out (you can EASILY test by setting the time-out to an impossibly high figure!)
3. You have a corrupt resource file that when it backs that up it falls over (you can EASILY test this by making sure you can OPEN/VIEW every single course resource!)

I still think its number 1.

Regards,

John
In reply to John White

Re: Course Backup Problem

by rui gomes -
Hello,

First i would like to thank every user that tried to help me out on this, a special thanks to John White that was incredible in the way he tried to help.

Now the solution that might help someone in the future.

On the backup process you will have a step where you need to select several check boxes, specially in big courses.

After the selection you will go through the next step, here is where the problem can come up. Because this post may include more than 500 fields and many hosting providers limit the number of fields that can be posted to prevent excessive big forms to be created that may bring the servers down or make them sluggish, so to prevent this they use suhosin - http://www.hardened-php.net/suhosin/ - running php with suhosin limits the number of fields that can be posted, and here was my problem, the limit was set to 200 and i needed at least 600.

I contacted the hosting provider and they changed this values for me.

Hope this help you in the future.

Regards,

Rui Gomes
Average of ratings: Useful (1)
In reply to rui gomes

Re: Course Backup Problem

by John White -
Well done Rui!
In reply to John White

Re: Course Backup Problem

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
It is really nice when someone finds a solution and actually posts it back on a forum for others in future - thankyou. smile
Average of ratings: Useful (1)
In reply to Mary Cooch

Re: Course Backup Problem

by Jonathan Taylor -
That suhosin patch has been causing all sorts of problems for our moodle site as well. By default its memory limit is set to 0 and overrides the limit set in php.ini

This same issue was a huge frustration for me as well, as trying to back up large courses would log me out of moodle.

To fix this backup issue, I uncommented (is that a word) the lines suhosin.request.max_vars and suhosin.post.max_vars in /etc/php5/conf.d/suhosin.ini and set them to 600 along with suhosin.memory_limit being set to match my php.ini limit.

Large course now successfully back up.

Woohoo!!


In reply to Jonathan Taylor

Re: Course Backup Problem

by Mitchell Roberts -
As a tip for others that stumble upon this, if you are getting an error message like this:

[Wed Jun 23 13:25:46 2010] [error] [client your.ip.add.ress] ALERT - script tried to increase memory_limit to 201326592 bytes which is above the allowed value (attacker 'your.ip.add.ress', file '/srv/www/htdocs/lib/setuplib.php', line 80), referer: http://moodle.fsd38.ab.ca/backup/backup.php?id=246


Means you should follow the steps above!