Quantcast
Channel: Backup and restore
Viewing all articles
Browse latest Browse all 6815

Backup Restore is Not Working

$
0
0
by Eu Hua Tan.  

Hi all,

Some context, I have just upgraded Moodle from 4.2 to 4.4 recently. Stumble upon this issue when using course reuse/restore to restore the backup into a new course. Backup is working as expected, however trying to restore the course throw some errors where the course is pending for restore.

I put on my developer hat and trying to identify the problem. When choosing the restore options, I can see the course entry created in mdl_course table in the db.

For example

ID: 2903

Fullname: Course restoration in progress copy 1

All is well, until when i click "perform restore". The entry is delete from the mdl_course table. And then I get this error:

dml_missing_record_exception
Can't find data record in database table course. (SELECT id,category FROM {course} WHERE id = ? [array ( 0 => 8432, )])

The ID 8432 seems out of place, as the created new course ID should have been 2903, as per the example above. Upon checking further 8432 seems to be the latest id for an entry in mdl_customfield_data. I am using 4 custom fields in my courses for various meta details. For some reason the backup tool is refering to the wrong ID, so I am wondering if anyone has a fix?

Stacktrace:
#28 dml_missing_record_exception in D:\dev\php8.3\academy44\lib\dml\moodle_database.php:1659
#27 moodle_database:get_record_select in D:\dev\php8.3\academy44\lib\dml\moodle_database.php:1635
#26 moodle_database:get_record in D:\dev\php8.3\academy44\lib\classes\context\course.php:200
#25 core\context\course:instance in D:\dev\php8.3\academy44\course\classes\customfield\course_handler.php:185
#24 core_course\customfield\course_handler:get_instance_context in D:\dev\php8.3\academy44\course\classes\customfield\course_handler.php:127
#23 core_course\customfield\course_handler:can_view in D:\dev\php8.3\academy44\customfield\classes\handler.php:785
#22 core_customfield\handler:core_customfield\{closure} in [internal]:0
#21 array_filter in D:\dev\php8.3\academy44\customfield\classes\handler.php:783
#20 core_customfield\handler:get_visible_fields in D:\dev\php8.3\academy44\customfield\classes\handler.php:377
#19 core_customfield\handler:get_instance_data in D:\dev\php8.3\academy44\customfield\classes\handler.php:524
#18 core_customfield\handler:restore_define_structure in D:\dev\php8.3\academy44\backup\moodle2\restore_stepslib.php:2019
#17 restore_course_structure_step:process_customfield in D:\dev\php8.3\academy44\backup\util\plan\restore_structure_step.class.php:137
#16 restore_structure_step:process in D:\dev\php8.3\academy44\backup\util\helper\restore_structure_parser_processor.class.php:123
#15 restore_structure_parser_processor:dispatch_chunk in D:\dev\php8.3\academy44\backup\util\xml\parser\processors\grouped_parser_processor.class.php:178
#14 grouped_parser_processor:postprocess_chunk in D:\dev\php8.3\academy44\backup\util\helper\restore_structure_parser_processor.class.php:111
#13 restore_structure_parser_processor:postprocess_chunk in D:\dev\php8.3\academy44\backup\util\xml\parser\processors\simplified_parser_processor.class.php:148
#12 simplified_parser_processor:process_chunk in D:\dev\php8.3\academy44\backup\util\xml\parser\processors\progressive_parser_processor.class.php:92
#11 progressive_parser_processor:receive_chunk in D:\dev\php8.3\academy44\backup\util\xml\parser\progressive_parser.class.php:189
#10 progressive_parser:publish in D:\dev\php8.3\academy44\backup\util\xml\parser\progressive_parser.class.php:277
#9 progressive_parser:end_tag in [internal]:0
#8 xml_parse in D:\dev\php8.3\academy44\backup\util\xml\parser\progressive_parser.class.php:178
#7 progressive_parser:parse in D:\dev\php8.3\academy44\backup\util\xml\parser\progressive_parser.class.php:157
#6 progressive_parser:process in D:\dev\php8.3\academy44\backup\util\plan\restore_structure_step.class.php:110
#5 restore_structure_step:execute in D:\dev\php8.3\academy44\backup\util\plan\base_task.class.php:186
#4 base_task:execute in D:\dev\php8.3\academy44\backup\util\plan\base_plan.class.php:191
#3 base_plan:execute in D:\dev\php8.3\academy44\backup\util\plan\restore_plan.class.php:168
#2 restore_plan:execute in D:\dev\php8.3\academy44\backup\controller\restore_controller.class.php:411
#1 restore_controller:execute_plan in D:\dev\php8.3\academy44\backup\util\ui\restore_ui.class.php:219
#0 restore_ui:execute in D:\dev\php8.3\academy44\backup\restore.php:146

Regards,

Eu Hua


Viewing all articles
Browse latest Browse all 6815

Trending Articles