Restore Stops

Restore Stops

by Anthony Ellul -
Number of replies: 22

Hi all new to posting here I am using version 1.9 of moodle the latest one (today) and am trying to restore a course from another moodle site and i backup and upload sucessfully but then when I try to restore the course it seems to freeze please see with the link below, I have waited for ages to see if it finishes off but doesn't seem to do anything else.

http://i286.photobucket.com/albums/ll104/lt_caine/restoreproblem.jpg

I did see a post which was saying about a maximum size limit of 12 or 16MB but this is is only 3.5MB when zipped and 4 when unzipped so if any1 can help then it's much appreciated.

Average of ratings: -
In reply to Anthony Ellul

Re: Restore Stops

by Valery Fremaux -

Take care the course you are restoring may contain data from additional module you may not have installed in your Moodle.

If restore freezes, it is likely because of an unknown function being called. You may not see anything because the "debug" mode is off, and the server will not mention any word about the error.

Go to admin->server->debug and turn debug on (not developper, only all errors), go back to the restore procedure and try it again. You may see real error messages that will be prompted on the white page such as a fatal_error that may give you an indication about the source of failure.

Cheers.

In reply to Valery Fremaux

Re: Restore Stops

by Ulrike Montgomery -
I'm having a similar problem. Backup and restore works fine within my own Moodle installation. However, when I try to restore one of my courses to another Moodle installation I get an error message (turned on debug) . A screenshot is attached.
Another strange thing: all my old backups which I made from 1.8. restore fine. It's only the backups from 1.9. that freeze.

Both Moodle installations are 1.9.1+. Both are on a Linux server - the only difference is that mine has php 5.1.6 and the other one 5.1.2 .
Other than feedback, book and detailed responses (quiz module), there are no 3rd party modules.

Any help is greatly appreciated.

Cheers,

Ulrike
Attachment restore.gif
In reply to Ulrike Montgomery

Re: Restore Stops

by Theresa Ru -
I'm also having this problem. When I'm trying to restore a teacher's backup from a 1.9+ version to a 1.9 version of Moodle, I get a similar Fatal error message as Ulrike's above, but a different line # is referenced:

Fatal error: Class 'message' not found in [dirroot]\moodle\backup\restorelib.php on line 6710

The 1.9 and 1.9+ Moodle versions are on different servers at different schools so the modules may not be exactly the same. But the reference to restorelib.php Line 6710 shows some interesting code that deals with comparing Moodle versions. Line 6710 contains this assignment:

$message = new message();

This message() class is not defined in the same restorelib.php file. Where is it located? Is this important? Is version 1.9+ backwards compatible with 1.9?

//We compare Moodle's versions
if ($CFG->version < $info->backup_moodle_version && $status) {
$message = new message();
$message->serverversion = $CFG->version;
$message->serverrelease = $CFG->release;
$message->backupversion = $info->backup_moodle_version;
$message->backuprelease = $info->backup_moodle_release;
print_simple_box(get_string('noticenewerbackup','',$message), "center", "70%", '', "20", "noticebox");

Also, the moodle.xml file seems to be complete, and I tried changing the beginning INFO item ORIGINAL_WWWROOT from the URL reference to $@FILEPHP@, but this didn't do anything. Any help would be greatly appreciated.

Thanks, Theresa
In reply to Theresa Ru

Re: Restore Stops

by Anthony Ellul -
I have the same message as Theresa gets but mine is on line 7302 and it contains the same string of: $message = new message();
In reply to Theresa Ru

Re: Restore Stops

by Theresa Ru -
I think I fixed the problem for my situation, at least on a test server. I upgraded our Version 1.9 system to the Latest Stable Build 1.9.1+, and restored the teacher's Version 1.9+ file with no problems. It seems that backup files created on Version 1.9+ servers are not backwards compatible to Version 1.9 systems.

Also, during the upgrade, I noticed a message flash by really quickly that older versions were detected. There was more to the message but it went by too fast to read.

When I tried to restore backup files from the Version 1.9 system (older) to the upgraded Version 1.9.1+ server, I got several of these types of messages:

Notice: Undefined property: stdClass::$nameincourse in C:\xampp\htdocs\moodle\backup\restorelib.php on line 8359

It's interesting -- I don't think any of the Version 1.9 backup files (zip) migrated to the Version 1.9.1+ system.

Cheers,
Theresa
In reply to Theresa Ru

Re: Restore Stops

by Ulrike Montgomery -
Theresa,

I think it's a bug. I have just filed MDL-15282.

Cheers,

Ulrike
In reply to Ulrike Montgomery

Re: Restore Stops

by Ray Le Couteur -
The bug filed above refers to a backup in 1.91+ failing in 1.9.

I get the more serious problem described by Theresa, where an older backup could not be restored to a newer moodle version:

"When I tried to restore backup files from the Version 1.9 system (older) to the upgraded Version 1.9.1+ server, I got several of these types of messages:

Notice: Undefined property: stdClass::$nameincourse in C:\xampp\htdocs\moodle\backup\restorelib.php on line 8359

It's interesting -- I don't think any of the Version 1.9 backup files (zip) migrated to the Version 1.9.1+ system."
********************************************************************************

My server is also on a Windows system and displays similar messages:

  • Course format data
  • Checking instances
    Could not adjust instances in course_modules!
  • Creating roles definitions
Notice: Undefined property: stdClass::$nameincourse in E:\webroot\htdocs\moodle\backup\restorelib.php on line 8359
Creating course level role assignments and overrides Creating module level role assignments and overrides Creating block level role assignments and overrides Creating user level role assignments and overrides Closing the Restorelog.html file.
An error has occurred and the restore could not be completed!
Stack trace:
  • line 1651 of lib\deprecatedlib.php: call to debugging()
  • line 50 of backup\restore_execute.html: call to error()
  • line 168 of backup\restore.php: call to include_once()

In reply to Ray Le Couteur

Re: Restore Stops

by Ray Le Couteur -
More on this issue.

Tried to install the Moodle Feature demo(http://moodle.org/mod/resource/view.php?id=4208) on Moodle 1.9.1 (Build: 20080515):


Got a number of errors on install:
    • Lesson "How to use the Lesson Module" . .
    Notice: Undefined index: MD5HASH in E:\webroot\htdocs\moodle\mod\scorm\restorelib.php on line 51

    Notice: Undefined index: UPDATEFREQ in E:\webroot\htdocs\moodle\mod\scorm\restorelib.php on line 56
  • SCORM/AICC "eXe package"
Notice: Undefined index: MD5HASH in E:\webroot\htdocs\moodle\mod\scorm\restorelib.php on line 51

Notice: Undefined index: UPDATEFREQ in E:\webroot\htdocs\moodle\mod\scorm\restorelib.php on line 56
SCORM/AICC "RELOAD demo package" Hot Potatoes Quiz "Newton's 2nd and 3rd Laws Pretest" Hot Potatoes Quiz "Crossword Puzzle with Timer" Creating blocks Course format data Checking instances
Could not adjust instances in course_modules!
Creating roles definitions Creating course level role assignments and overrides Creating module level role assignments and overrides Creating block level role assignments and overrides Creating user level role assignments and overrides Closing the Restorelog.html file.
An error has occurred and the restore could not be completed!
Stack trace:
  • line 1651 of lib\deprecatedlib.php: call to debugging()
  • line 50 of backup\restore_execute.html: call to error()
  • line 168 of backup\restore.php: call to include_once()


Any ideas?
In reply to Ray Le Couteur

Re: Restore Stops

by Ray Le Couteur -
I have tracked down the problem:

It was associated with this error on the front page:

Site news

Can't create/write to file 'C:\xampp\tmp\#sql_9fc_0.MYD' (Errcode: 17)

SELECT p.*, d.name, d.timemodified, d.usermodified, d.groupid, d.timestart, d.timeend, u.firstname, u.lastname, u.email, u.picture, u.imagealt FROM mdl_forum_discussions d JOIN mdl_forum_posts p ON p.discussion = d.id JOIN mdl_user u ON p.userid = u.id WHERE d.forum = 3 AND p.parent = 0 ORDER BY p.modified DESC
  • line 686 of lib\dmllib.php: call to debugging()
  • line 966 of lib\dmllib.php: call to get_recordset_sql()
  • line 2250 of mod\forum\lib.php: call to get_records_sql()
  • line 4578 of mod\forum\lib.php: call to forum_get_discussions()
  • line 213 of index.php: call to forum_print_latest_discussions()
(No news has been posted yet)


It turns out that Mcaffee enterprise was locking the temporary database file (C:\xampp\tmp\#sql_9fc_0.MYD in this case) and preventing it being overwritten.

Solution : exclude all .MYI and .MYD database files from the Mcaffee on demand(?) scanning. We tried excluding the \tmp folder, but this didn't seem to work.
In reply to Theresa Ru

Re: Restore Stops

by Jonathan Harker -
Hi Theresa,

That line needs to be:

$message = new object();

HTH
Jonathan

In reply to Jonathan Harker

Re: Restore Stops

by Márcio Benedito -
Hey!

I edit the restorelib file and the restore process follow up , but an error in another point:

Creating the Restorelog.html in the course backup folder
Notice: Undefined property: stdClass::$groups in /var/www/moodle/backup/restorelib.php on line 7635

Notice: Undefined property: stdClass::$groups in /var/www/moodle/backup/restorelib.php on line 7635

Notice: Undefined property: stdClass::$groups in /var/www/moodle/backup/restorelib.php on line 7653

Notice: Undefined property: stdClass::$groups in /var/www/moodle/backup/restorelib.php on line 7653

Notice: Undefined property: stdClass::$groups in /var/www/moodle/backup/restorelib.php on line 7671
Criando seções
Fatal error: Call to undefined function get_file_url() in /var/www/moodle/backup/restorelib.php on line 3689
In reply to Márcio Benedito

Re: Restore Stops

by Márcio Benedito -
I am testing some options and found a strange behavior. I have a 1.9+ moodle as a developer course server. After all tests and customizations on course, the course creator make a course backup an then send the zip backup course file to the moodle server in production and run a restore function. But this dont work and the task stop like reported in this forum.
I make a test instalation server using moodle 1.8.2 and try a restore from the course backuped from moodle 1.9+ and have a success. Then I make a backup this course in moodle 1.8.2 an try run a restore in moodle 1.9.2, but dont work displaying diferent error messages:

The error message displayed runnig a course restore from a 1.9+ to 1.9+

Fatal error
: Class 'message' not found in /opt/websites/ead-moodle/backup/restorelib.php on line 7292

The error message displayed runnig a course restore from a 1.8.2 to 1.9+

Fatal error: Call to a member function get_records() on a non-object in /opt/websites/ead-moodle/backup/restorelib.php on line 7417

I need the course backup and restore function working fine on moodle 1.9, this version increse some good functions very important to my job!
Can help us????
In reply to Márcio Benedito

Re: Restore Stops

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi,

the "Fatal error: Class 'message' not found in..." problem has been fixed in CVS some minutes ago (will be available in next weekly download). It was a silly typo preventing to restore backups generated in newer 1.9.x versions by older 1.9.x versions. It's, for the records MDL-15282.

the "Fatal error: Call to a member function get_records() on a non-object...", I'm not able to find what exact line is the problematic one. For sure that file has changed since your running versions. Could you provide the version of the file (something like $Id: in the first line of restorelib.php). Or alternatively... can you update to latest 1.9.x+ weekly version and try it?

Note that a bunch of things have been improved since Moodle 1.9.0 in the backup/restore process, with more coming next weeks, so it's really interesting (not only because of this) to be using recent 1.9.x+ weekly builds as possible.

Ciao smile


Average of ratings:Useful (1)
In reply to Eloy Lafuente (stronk7)

Re: Restore Stops

by Márcio Benedito -
Hy ELoy;

I try upload to my server _only_ the restorelib.php file from cvs, and the error message "Fatal error: Class 'message' not found in..." was fixed, but the "Fatal error: Call to a member function get_records() on a non-object..." still be displayed. The error line is 7515:
7513 //Checks for the required files/functions to restore every module
7514 //and include them
7515 if ($allmods = $DB->get_records("modules") ) {


In reply to Márcio Benedito

Re: Restore Stops

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Mácio,

I think you have downloaded the 2.0dev restorelib.php file, instead of the 1.9 one! Be careful not mixing versions! You need to be in the correct MOODLE_XX_STABLE branch to update the correct file.

Ciao smile
In reply to Eloy Lafuente (stronk7)

Re: Restore Stops

by Márcio Benedito -
Hy Eloy;

I stop my service for some minutes and make upgrade my moodle server to moodle-weekly build 20080806 and my problem is solved.

Thank you for help us !!!!!
In reply to Márcio Benedito

Re: Restore Stops

by Davood Rahimi Kinchaa -
Hi,
my problem is:
restore stops at unzipping backup.
backup file size: 400 MB
any idea please.
In reply to Davood Rahimi Kinchaa

Re: Restore Stops

by J Rob -

I'm having this same problem with Moodle 1.9.9+ (Build: 20100825) on Windows Server 2003, PHP version 5.2.0. I go to restore the course, and it just stops at the "Unzipping backup" line. Here's the display I get:

I've turned on the php error debugging, and I get nothing in the php error log file. I've already ascertained that there are no bogged down processes on the server... so it's not that the IIS worker process is waiting or still trying.

I've also tried switching from the built-in php zip functionality to the GNU Win32 zip package, trying both "program files" and "progra~1", no change in behaviour.

The backup file I'm trying to use is 45MB, but I got the same behaviour with a 27KB backup file.

Please help!

In reply to J Rob

Re: Restore Stops

by Matt Kubasik -

I experience the same behavior attempting to restore a 34 MB backup file using:

Moodle 1.9.10+ (Build 20110105)

PHP 5.2.15

Hostgator "hatchling" plan.

I set memory_limit = 128M, but this did not help.

Debugging is enabled, but there are no reported errors.  My restore attempts for large (34MB) backups stall just like J Rob's, above.

I attempted to give an "unzip path" (/usr/bin/unzip) but this did not help.

I set max_execution_time to 60, but this did not help.

Restoring small backup files works fine.

Unzipping (large) backup file within course files area of course works fine.

Any hints to solve this problem will be appreciated.

 

In reply to Matt Kubasik

Re: Restore Stops

by Matt Kubasik -

Update:

Using /usr/bin/unzip in the UNZIP path, "restore" no longer stalls.  Same positive solution as in http://moodle.org/mod/forum/discuss.php?d=124176.

In reply to Matt Kubasik

Re: Restore Stops

by Przemek Krakowian -

Had a similar problem: two smaller (under 2 MB) restores worked fine, but a 2,7 MB restore would stall. No warning messages, no errors in debugging.

/usr/bin/unzip did the trick for me. Place it in the system paths where the unzip path is left blank by default.

Best