There are several options to delete one or many courses. I would like to understand what happens in detail when I start delete courses processes?
Here are the scenarios and I think about it. I'm not a developer.
Deleting a single course course/delete.php
The process starts a search in database for all entries realted to the course id. Files are added in trashdir. When the process is finished the course isn't visible in the system anymore.
When category recycle bin is enabled a course backup is benn created before anything is deleted.
Deleting a course category
This process starts the same but course by course for each course in the category. Recycle bin is not working for this process.
Deleting by course upload /admin/tool/uploadcourse/index.php
This process starts the course/delete.php process foreach course in the csv file
Are course backup created in recycle bin?
All these processes are limited by server side timeout settings
Deleting by Moodle plugins directory: Delete courses
This 3rd party plugin creates a task that runs several times until all course in the selected category are deleted. Its restarted by cron. Files are not put in trash dir if selected.
Is this correct?
Here are some findings and problems:
Large courses are not deleted. All processes stopps.
In some cases large courses with a lot of content and specially masses of assignment submissions are not deleted. The process stopps. These courses are complete. It seems that Moodle has not started to delete anything in the course, You can start the delete process several times and nothing happens. These courses have to be deleted course topic by course topic in the course until you can delete the course.
Mass course deleting process fill the harddisk
Storage on hard disks is limited. Deleting hundreds of courses creates a lot of stuff in trash dir. Deleting trash dir content runs every 4 hours in default settings. We've seen several times that hard disk is full for seeberal hours and users can't login.
This happens typically when a school creates a course category 'delete courses' for all courses that should be deleted at the end of a term. When they start course category delete process they create critical masses.
Are there any ideas how to handle this better?