Hi Ken,
i made progress. i went into mdl_assign and query for te course number. deleted those records and i could delete the course afterwards.
Now the issues is that i ahve 2 more dead courses that i need to remove. From the moosh cli i get this error on the second course"these courses are from 2014 very very old":
[root@ moodle2]# sudo -u apache /usr/local/bin/moosh course-delete 45582
About to delete course id=45582; shortname=20010-PSY3301-201920111; category id=77++ Deleted - Completion tracking ++
++ Deleted - Grades, Items, Categories ++
++ Deleted - Outcomes ++
++ Deleted - Scales ++
++ Deleted - Settings ++
++ Deleted - Letters ++
++ Deleted - Blocks ++
++ Deleted - Forum ++
++ Deleted - Label ++
++ Deleted - External tool ++
++ Deleted - Page ++
++ Deleted - File ++
++ Deleted -
Turnitin Assignment 2 ++
++ Deleted -
URL ++
++ Deleted - Activity modules ++
|
| top | This category has been deleted because, after deleting the course, its questions weren't used any more. |
| Default for 20010-PSY3301-201920111 | This category has been deleted because, after deleting the course, its questions weren't used any more. |
++ Deleted - Questions ++
++ Deleted - Enrolment methods ++
++ Deleted - Groupings ++
++ Deleted - Groups ++
[root@ moodle2]# sudo -u apache /usr/local/bin/moosh course-list "fullname like '%%'"
"id","category","shortname","fullname","visible"
"7272","Top/dead classes","MTA SP 14","Marketing the Arts / GURALNIK (SP14)","0"
"7335","Top/dead classes","SP14-monks7335","Vertebrate Zoology / MONKS (SP14)","0"
[root@ moodle2]# sudo -u apache /usr/local/bin/moosh course-delete 7272
About to delete course id=7272; shortname=MTA SP 14; category id=77++ Deleted - Completion tracking ++
++ Deleted - Grades, Items, Categories ++
++ Deleted - Outcomes ++
++ Deleted - Scales ++
++ Deleted - Settings ++
++ Deleted - Letters ++
++ Deleted - Blocks ++
++ Did you remember to make the first column something unique in your call to get_records? Duplicate value '' found in column 'id'. ++
* line 1256 of /lib/dml/mysqli_native_moodle_database.php: call to debugging()
* line 5227 of /lib/moodlelib.php: call to mysqli_native_moodle_database->get_records_sql()
* line 5110 of /lib/moodlelib.php: call to remove_course_contents()
* line 41 of /opt/moosh/Moosh/Command/Moodle23/Course/CourseDelete.php: call to delete_course()
* line 354 of /opt/moosh/moosh.php: call to Moosh\Command\Moodle23\Course\CourseDelete->execute()
Default exception handler: Can't find data record in database. Debug: SELECT cm.*, m.name, md.name AS modname
FROM {course_modules} cm
JOIN {modules} md ON md.id = cm.module
JOIN {assign} m ON m.id = cm.instance
WHERE m.id = :instance AND md.name = :modulename
[array (
'instance' => '18309',
'modulename' => 'assign',
)]
Error code: invalidrecordunknown
* line 1590 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
* line 1281 of /lib/datalib.php: call to moodle_database->get_record_sql()
* line 52 of /mod/assign/lib.php: call to get_coursemodule_from_instance()
* line 5242 of /lib/moodlelib.php: call to assign_delete_instance()
* line 5110 of /lib/moodlelib.php: call to remove_course_contents()
* line 41 of /opt/moosh/Moosh/Command/Moodle23/Course/CourseDelete.php: call to delete_course()
* line 354 of /opt/moosh/moosh.php: call to Moosh\Command\Moodle23\Course\CourseDelete->execute()
!!! Can't find data record in database. !!!
[root@ moodle2]#