by Diane Soini.
Okay I think I figured it out. Moodle has decided that it won't actually export LTI tool information for pre-configured tools. It leaves everything null except the name and database id, even the toolurl is null, and assumes the information can be found in the database with the database id. In this way it is impossible to properly restore the pre-configured tools in a course to another system.
I've had to add a hack to do a database query on the name of the pre-configured tool. Name and course = 1. Take the most recent one and match that up. That was the only way I could figure out how to map them to a new system. Since both of these are our systems this should work okay because we will set up our new system to name the tools the same thing and have them ready to go before the migration we are planning to do.
I hacked the code of mod/lti/backup/moodle2/restore_lti_stepslib.php find_existing_lti_type function and added a section of code to query on name = :name and course = 1 right after the block of code that always fails because it's not really the same site even though it thinks it is. I also added code to the process_ltitype function to update the name of the tool to add " - not fully restored" if a match was not found by name with the pre-configured tools and there is no toolurl in the data.
Hope that helps any devs out there who are struggling with this.
I've had to add a hack to do a database query on the name of the pre-configured tool. Name and course = 1. Take the most recent one and match that up. That was the only way I could figure out how to map them to a new system. Since both of these are our systems this should work okay because we will set up our new system to name the tools the same thing and have them ready to go before the migration we are planning to do.
I hacked the code of mod/lti/backup/moodle2/restore_lti_stepslib.php find_existing_lti_type function and added a section of code to query on name = :name and course = 1 right after the block of code that always fails because it's not really the same site even though it thinks it is. I also added code to the process_ltitype function to update the name of the tool to add " - not fully restored" if a match was not found by name with the pre-configured tools and there is no toolurl in the data.
Hope that helps any devs out there who are struggling with this.