Issues with Restoring courses on Moodle 2.4

Issues with Restoring courses on Moodle 2.4

by Brett Drinkwater -
Number of replies: 11

Hi All

We've just upgraded our moodle from 2.2 to 2.4 with no errors and so far, full functionality. Prior to upgrade 2.2 courses could be backed up and restored without issue.

Since the upgrade, restore attempts fail with php max execution time errors. Initially error at 30sec, incresed to 60sec and still same issue. I wouldnt expect it would need to go above 60sec when it was working without issue on 2.2.

Issue occurs with courses backed up on 2.2 as well as freshly backed up on 2.4

No other errros appear in the error log.

Fatal error: Maximum execution time of 60 seconds exceeded in /moodle/lib/filestorage/zip_archive.php on line 194


I cant find similar error in the forums. I'd be grateful for any suggestions

Cheers

Brett

Average of ratings: -
In reply to Brett Drinkwater

Re: Issues with Restoring courses on Moodle 2.4

by Ken Task -
Picture of Particularly helpful Moodlers

'I wouldnt expect it would need to go above 60sec when it was working without issue on 2.2.'

Errrr ... are you saying you can't increase max time to execute beyond 60 seconds? or that one shouldn't have to IF it worked under 60 in version 2.2?

Uhhhh ... kinda been my experience that Moodle 2 requires 'more' cause there is more to do, so what happens if the max is increased to 120 seconds?

'spirit of sharing', Ken

In reply to Ken Task

Re: Issues with Restoring courses on Moodle 2.4

by Brett Drinkwater -

Thanks Ken, I'm concerned that a 35mb backup file needs more than 60 seconds to restore. It's hanging somewhere in the process.  I didnt think the backup/restore process of 2.2 was that radically different from 2.4 and for this file to take so long, something isnt right.

I tried 90 and 120 with the same issue.  

Im told this course was imported from 1.9 when their moodle went from 1.9 to 2.2, with many problems. My guess is that its something to do with legacy 1.9 migration issues.

Thanks for your suggestions.

Cheers

Brett

In reply to Brett Drinkwater

Re: Issues with Restoring courses on Moodle 2.4

by Ken Task -
Picture of Particularly helpful Moodlers

Been my experience that courses that are used seldom reduce in size ... they only grow over time.

' ... was imported from 1.9 when their moodle went from 1.9 to 2.2, with many problems.'

That could be true, for sure.  Problems that existed don't necessairly get automagically fixed. sad  Now it depends upon how 'valuable' that course was to justify the manual work that might need be done to restore it.

Have you unzipped the 1.9 backup file locally and checked the moodle.xml file to see just what version of 1.9 this backup file comes from?

Does the moodle.xml file also include roles?

Did the backup contain an add-on module no longer supported in 2 ... like journal?

One can reduce the size of a 1.9 backup by manually editing the moodle.xml file and removing tags that reference files found in course_files.

Move the course_files directory out of the work space used for inspecting the unzipped backup.  One could then re-zip the backup and use the reduced size zip to restore.

All the links to files, of course, will be busted, but once the course is established, create a repo for it and then by means other than Moodle UI (scp/ftp/mount, etc.) copy the contents of course_files to that course repo.  Now the teacher has all the files that were in the course before and they must re-link them.  Yes, that could be a lot of work also, but NO LEGACY.

Think I'd try that IF it was a 'valueable course'. ;)

'spirit of sharing', Ken

In reply to Ken Task

Re: Issues with Restoring courses on Moodle 2.4

by Ken Task -
Picture of Particularly helpful Moodlers

Hmmm ... replying to my own post! :|

Have done what I've suggested … to verify it can be done.
Moodle is version 2.4.2 (Build: 20130311)

1.9 backup file originally 32.8 Meg

Unzipped a 1.9 backup locally on HD.

Moved course_files folder outside the 'build' directory.

*Didn't* edit the moodle.xml file any at all.

Re-zipped using only the files/folders that remained … including the moodle.xml file.

Zip file is now 53KB.

Got into the 2.4 Moodle.

Started a new course with basic information.

When reaching the point of enrolling users, instead, went to restore.

Uploaded the 53K re-constructed zip and restored the course.

Errors are reported in apache error_log like this:

[Wed Mar 13 22:49:56 2013] [error] [client xx.xxx.xxx.xxx] (moodle1) error migrating the resource main file course_files/imlog/messagelog.txt, referer: http://site/moodle24/backup/restore.php

And they were indeed true.

All links/activities that could xfer showed as links (including folders).  Those links that went to files had to be reconstructed.

Created a file system repo for the course pointed to 'course_files' folder.

Uploaded all the contents of the local course_files folder to the 'couse_files' repo on the server via scp (one could use FTP or other).

Re-linked all files from the course_files repo.

Best thing about the 'work' required … NO LEGACY.

Care to see:
http://sos.tcea.org/moodle24/course/view.php?id=1675

Guest access allowed.  Some links still broke … needed zzzzzzzzzz's.

'spirit of sharing', Ken

Average of ratings: Useful (2)
In reply to Ken Task

Re: Issues with Restoring courses on Moodle 2.4

by Brett Drinkwater -

Ken,

Sorry for delayed response. End of a very hectic end of week.

Thanks so much for your comprehensive solution.

I very much appreciate the trouble you've gone to in order to find an alternative to the regular restore process.

I'll run through all of this over the weekend and let you know how we go.

Many thanks

Brett

In reply to Brett Drinkwater

Re: Issues with Restoring courses on Moodle 2.4

by John Reese -

give it some large number like 600 (10 minutes) ... if it's a large file, you may need a larger number

In reply to John Reese

Re: Issues with Restoring courses on Moodle 2.4

by Brett Drinkwater -

Thanks John, the file is only small at 35mb.

If it takes 10 mins to restore, there is something drastically wrong that I would like to correct before we go further with course restores.

Cheers

Brett

In reply to Brett Drinkwater

Re: Issues with Restoring courses on Moodle 2.4

by SVI eSolutions -

Has anyone else experienced this? I have recently upgraded from 2.0.3 to moodle 2.4.1. When I make a course backup I have no warnings or errors. When I try to restore it, the site turns and turns but it does not restore past the first page and in that page the links don't work....

I have increaded the uploading limit as my backup is huge... but this did not help. I have increased the maximum time to 10 minutes, but this did not help. I tried saving and restoring only part of the cours pour this did not work. I have tried creating a new cours, saving it and restoring it and that worked fine!

The cours would be VERY long to start again, can anyone help!?!

In reply to Brett Drinkwater

Re: Issues with Restoring courses on Moodle 2.4

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Do you by chance have a large question bank attached - sometimes that will take an extremely long for the initial restore.  Also, are you restarting your webserver after you change the php setting?

In reply to Brett Drinkwater

Re: Issues with Restoring courses on Moodle 2.4

by Gordon Toudt -

I am having issues with 2.4 backup, restore and import.   When each times out... it kicks out a restore.php file and downloads it to me. ....backup.php and import.php files respectively.   We are on a Windows server.   I can get through the restore process if the course is below 345Mb in size.  anything larger kicks this back and  does not let me get to the next page, after the upload or selection from the repository in the restore process.   What takes so long?  We are talking 10 minutes minimum before this kicks back a file.   

Changes have been tried in the config.php files.  What other things could be causing this?   There is not an error message at all.

 

In general the site tends to run slowly from logins to page renders.  but not so much that it becomes a problem.   I have looked at the server recommendations listed in and have them set to that so what else can be done?