Moodle 333 server: Windows Server 2016 Moodle 3.3.3
SQL Server: Windows Server 2016 SQL Server 2014
Process: Testing for upgrade. Backing up course from Moodle 2.7.3 and restoring to Moodle 3.3.3. During restore, error below occurs. Stack trace available if needed.
THANKS for looking. Please advise if you think this needs to go to the bug tracker (or whatever name is in use now).
Error reading from database
Debug info: SQLState: 42000<br>
Error Code: 8114<br>
Message: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Error converting data type nvarchar to bigint.<br>
SELECT * FROM #mdl_backup_ids_temp WITH (NOLOCK) WHERE backupid = N'5eb9af421d519f5df459f6d4c235155b' AND itemname = N'forum_discussion' AND itemid = N'3676#p9665'
0 => '5eb9af421d519f5df459f6d4c235155b',
1 => 'forum_discussion',
2 => '3676#p9665',
Error code: dmlreadexception
line 486 of \lib\dml\moodle_database.php: dml_read_exception thrown
line 324 of \lib\dml\sqlsrv_native_moodle_database.php: call to moodle_database->query_end()
line 431 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->query_end()
line 896 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->do_query()
line 972 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->get_recordset_sql()
line 1558 of \lib\dml\moodle_database.php: call to sqlsrv_native_moodle_database->get_records_sql()
line 1530 of \lib\dml\moodle_database.php: call to moodle_database->get_record_sql()
line 1509 of \lib\dml\moodle_database.php: call to moodle_database->get_record_select()
line 240 of \backup\util\dbops\restore_dbops.class.php: call to moodle_database->get_record()
line 1673 of \backup\util\dbops\restore_dbops.class.php: call to restore_dbops::get_backup_ids_cached()
line 200 of \backup\util\helper\restore_log_rule.class.php: call to restore_dbops::get_backup_ids_record()
line 140 of \backup\util\helper\restore_log_rule.class.php: call to restore_log_rule->parse_tokens_and_matches()
line 84 of \backup\util\helper\restore_logs_processor.class.php: call to restore_log_rule->process()
line 3160 of \backup\moodle2\restore_stepslib.php: call to restore_logs_processor->process_log_record()
line 137 of \backup\util\plan\restore_structure_step.class.php: call to restore_activity_logs_structure_step->process_log()
line 112 of \backup\util\helper\restore_structure_parser_processor.class.php: call to restore_structure_step->process()
line 178 of \backup\util\xml\parser\processors\grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
line 100 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 190 of \backup\util\xml\parser\progressive_parser.class.php: call to progressive_parser_processor->receive_chunk()
line 278 of \backup\util\xml\parser\progressive_parser.class.php: call to progressive_parser->publish()
line ? of unknownfile: call to progressive_parser->end_tag()
line 179 of \backup\util\xml\parser\progressive_parser.class.php: call to xml_parse()
line 158 of \backup\util\xml\parser\progressive_parser.class.php: call to progressive_parser->parse()
line 110 of \backup\util\plan\restore_structure_step.class.php: call to progressive_parser->process()
line 181 of \backup\util\plan\base_task.class.php: call to restore_structure_step->execute()
line 201 of \backup\moodle2\restore_activity_task.class.php: call to base_task->execute()
line 178 of \backup\util\plan\base_plan.class.php: call to restore_activity_task->execute()
line 167 of \backup\util\plan\restore_plan.class.php: call to base_plan->execute()
line 339 of \backup\controller\restore_controller.class.php: call to restore_plan->execute()
line 224 of \backup\util\ui\restore_ui.class.php: call to restore_controller->execute_plan()
line 135 of \backup\restore.php: call to restore_ui->execute()
Don't run Windows, but .... think there is something that might help as requirements for many things for Moodle 3.x-> seem to be a moving target these days ...
In your 2.7, Site Admin -> Server -> Environment ... update the component ... and then in the drop down pick list that allows you to choose what higher version to check, select Moodle 3.3. Supposedly, if there is anything you need to upgrade (like PHP) or change (like config changes to supported databases), moodle should warn. Go to the bottom of that output and see what it says.
'spirit of sharing', Ken
Thanks for the response, Helen.
I did search (and will be searching again,) but Error 8114 is a generic error code that covers a lot of ground. None of the other instances I have found have given me a clue so far. I welcome any further thoughts.
In this case, that does not help. The only contingency exposed was a new version of PHP, which I already have in place.
I think this is going to be a Moodle "internals" problem because the DB tables in question are temp tables created by the restore process and I don't see that process described in any detail anywhere -- yet.
I am hoping someone has had the same or very similar problem. I am not looking forward to a line by line search through php code and ODBC drivers to see exactly where/how the data type conversion is failing.<G>
If you have any other suggestions on things to try or places to ask, I appreciate it.