Backup and restore

 
 
Picture of Ali Hastie
Moodle 2.2.2+ define restore log rules
 
I have a Moodle 2.0.6+ full course backup, including users, activities and logs etc and trying to restore the course backup to a Moodle 2.2.2+ installation but receive the following error: Coding error detected, it must be fixed by a programmer: define_restore_log_rules() method needs to be overridden in each subclass of restore_activity_task. Also found this in the Apache error logs: Potential coding error - existing temptables found when disposing database. Must be dropped!, referer: http://pigs.barony.ac.uk/backup/restore.php Cheers Ali
 
Average of ratings: -
Picture of Howard Miller
Re: Moodle 2.2.2+ define restore log rules
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers
Hi Ali,

can you do that again with Debugging switched on so we can see where it's going wrong. My immediate guess is that this might be caused by an optional plugin which doesn't implement restor properly. Is that possible?

Howard
 
Average of ratings: -
Picture of Ali Hastie
Re: Moodle 2.2.2+ define restore log rules
 
Hi Howard, Here you go: Stack trace: line 250 of /backup/moodle2/restore_activity_task.class.php: coding_exception thrown line ? of unknownfile: call to restore_activity_task->define_restore_log_rules() line 50 of /backup/util/helper/restore_logs_processor.class.php: call to call_user_func() line 73 of /backup/util/helper/restore_logs_processor.class.php: call to restore_logs_processor->__construct() line 1934 of /backup/moodle2/restore_stepslib.php: call to restore_logs_processor::get_instance() line 131 of /backup/util/plan/restore_structure_step.class.php: call to restore_activity_logs_structure_step->process_log() line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process() line 125 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk() line 91 of /backup/util/helper/restore_structure_parser_processor.class.php: call to grouped_parser_processor->postprocess_chunk() line 148 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to restore_structure_parser_processor->postprocess_chunk() line 92 of /backup/util/xml/parser/processors/progressive_parser_processor.class.php: call to simplified_parser_processor->process_chunk() line 169 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk() line 253 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish() line ? of unknownfile: call to progressive_parser->end_tag() line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse() line 137 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse() line 105 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process() line 153 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute() line 182 of /backup/moodle2/restore_activity_task.class.php: call to base_task->execute() line 148 of /backup/util/plan/base_plan.class.php: call to restore_activity_task->execute() line 157 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute() line 310 of /backup/controller/restore_controller.class.php: call to restore_plan->execute() line 147 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan() line 46 of /backup/restore.php: call to restore_ui->execute() ----------------------------------------- END OF DEBUGGING ----------------------------------- Third party plugins (Which are installed on both Moodle installs): Blocks: checklist Mods: book and checklist Qtypes: ddmatch, order and multichoiceset Just tried the backup file within another of our Moodle installs, which is version 2.1.1+ and restored with no problems. Cheers Ali P.S. HTML editor on here doesn't seem to be working for me grrr, sorry
 
Average of ratings: -
Picture of Alex Rowe
Re: Moodle 2.2.2+ define restore log rules
 

Were you able to solve this issue? We are having the same problem using a 2.1 backup into 2.2.2. From some testing I think it may be due to the Restoring of Course logs, When all fields are ticked to restore (and were backed up) it fails but when I only untick the restore course logs checkbox the restore works. I'll include the error and stack trace from debugging below.

Thanks again if anyone can help.
Alex

Error:
Coding error detected, it must be fixed by a programmer: define_restore_log_rules() method needs to be overridden in each subclass of restore_activity_task

Stack Trace:
    line 250 of /backup/moodle2/restore_activity_task.class.php: coding_exception thrown
    line ? of unknownfile: call to restore_activity_task->define_restore_log_rules()
    line 50 of /backup/util/helper/restore_logs_processor.class.php: call to call_user_func()
    line 73 of /backup/util/helper/restore_logs_processor.class.php: call to restore_logs_processor->__construct()
    line 1934 of /backup/moodle2/restore_stepslib.php: call to restore_logs_processor::get_instance()
    line 131 of /backup/util/plan/restore_structure_step.class.php: call to restore_activity_logs_structure_step->process_log()
    line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
    line 125 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
    line 91 of /backup/util/helper/restore_structure_parser_processor.class.php: call to grouped_parser_processor->postprocess_chunk()
    line 148 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to restore_structure_parser_processor->postprocess_chunk()
    line 92 of /backup/util/xml/parser/processors/progressive_parser_processor.class.php: call to simplified_parser_processor->process_chunk()
    line 169 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk()
    line 253 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()
    line ? of unknownfile: call to progressive_parser->end_tag()
    line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse()
    line 137 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse()
    line 105 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process()
    line 153 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
    line 182 of /backup/moodle2/restore_activity_task.class.php: call to base_task->execute()
    line 148 of /backup/util/plan/base_plan.class.php: call to restore_activity_task->execute()
    line 157 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
    line 310 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
    line 147 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan()
    line 46 of /backup/restore.php: call to restore_ui->execute()

 
Average of ratings: -
Me, with my new 'slow explosion' hair!
Re: Moodle 2.2.2+ define restore log rules
Group DevelopersGroup Particularly helpful Moodlers

We've just come across this error in 2.3+. It's preventing courses from restoring and I dread to think what data it's leaving orphaned in the database. sad Will see what's happening on the Tracker.

 
Average of ratings: -
Me, with my new 'slow explosion' hair!
Re: Moodle 2.2.2+ define restore log rules
Group DevelopersGroup Particularly helpful Moodlers

That same backup won't restore into Moodle 2.2 (our production server) or 2.3 (our development server). I've filed a tracker entry here which, if this issue affects you, it would be useful to comment on, vote for, etc.

Tracker issue: http://tracker.moodle.org/browse/MDL-34172

 
Average of ratings: -
Me, with my new 'slow explosion' hair!
Re: Moodle 2.2.2+ define restore log rules
Group DevelopersGroup Particularly helpful Moodlers

I've been keeping this Tracker entry as up-to-date as possible with my experiences. When filed, we couldn't restore 2.2 backups into 2.3, which we got around by creating backups without user data, which then worked fine. Now, we can't restore 2.3 backups into 2.4 for the same reason (and with the same solution) with the added 'bonus' of receiving 500 internal server errors instead of the error mentioned on the Tracker post.

I can't in good conscience make the issue a blocker, as Moodle functions fine day-to-day, but the fact that we can only restore course backups without user data is a concern (the main reason we create these backups is for disaster recovery reasons).

I encourage anyone experiencing this to vote and comment on the issue on the tracker, as without raising it's awareness it will not be seen and won't be addressed.

 
Average of ratings: -
Me, with my new 'slow explosion' hair!
Re: Moodle 2.2.2+ define restore log rules
Group DevelopersGroup Particularly helpful Moodlers

Have updated the tracker entry to reflect that the same problem is also seen in 2.5, but have just spotted the 'fix', posted by Lawrence Ng.

 
Average of ratings: -