Unenroll all from all classes

What would be the best (most graceful) way to unenroll staff and students from all classes. A huge mistake was made with the class placements. Good things is no attendance, etc has been taken yet.

The following SQL would delete all course/class enrolments for a target year.

`DELETE gibbonCourseClassPerson
FROM gibbonCourseClassPerson
JOIN gibbonCourseClass ON (gibbonCourseClassPerson.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID)
JOIN gibbonCourse ON (gibbonCourseClass.gibbonCourseID=gibbonCourse.gibbonCourseID)
WHERE gibbonCourse.gibbonSchoolYearID=YOUR_SCHOOL_YEAR_ID`

You could append an AND gibbonCourseClassPerson.role = 'Student'` to target just one role.

It's a destructive operation, not to be used without knowing the consequences. Be sure to take a backup of your database, or at least your gibbonCourseClassPerson table, just in case.

This was the perfect solution for me. It worked. I do understand there is a time to use this - when you’ve just added students and staff to classes, haven’t done anything else, and need to reverse your changes.
And I tried everything on a clone of the site first, just to be sure.