by Perry Way.
I found the problem! Yay! Now how to fix it?
I went deep. I isolated the problem making a new script and adding all kinds of echo commands. The problem is I have a table missing in our database. How it is missing is beyond me, but I need to create a table named mdl_enrol_lti_tools.
I discovered this by outputting the exception object using print_r(). Then in that data, I saw the error clearly...
EXCEPTION!!!!
dml_read_exception Object
(
[error] => Table 'moodle.mdl_enrol_lti_tools' doesn't exist
[sql] => SELECT * FROM mdl_enrol_lti_tools WHERE enrolid = ?
[params] => Array
(
[0] => 12147
)
[errorcode] => dmlreadexception
[module] => error
[a] =>
[link] =>
[debuginfo] => Table 'moodle.mdl_enrol_lti_tools' doesn't exist
SELECT * FROM mdl_enrol_lti_tools WHERE enrolid = ?
[array (
0 => '12147',
)] snipped here for brevity.....
So, now it's a simple matter to find the definition for the table and create it manually and I believe the backup should work.