Our teachers find backup/restore "difficult", but they want to get a new course with their teacher-uploaded content just no student or student activity. For the teachers, the aim is to "clean" the system from student data leaving all the courses ready for a new run, keeping teacher input if possible. That means keeping teacher wikis or glossaries, for example. From a sysadmin point of view, technic people want to "clean" the database from all non-needed data from past years (they do not want unusable or inaccesible records to accumulate in the database).
We have written the needed functions
You may find a piece of the Reset page below. This page will list all modules used in the course (not all instances) and present some checkboxes for establishing desired actions and options. What should be considered an option is the question and the reason of this post asking for opinions.
In the example below you see Forums and 'subscriptions' or 'ratings' treated as options. But, if we are deleting all student's posts, keeping records with the rating of those posts doesn't make much sense. Even more, those ratings apply to a given postid we have deleted, so those records are basically useless now. To keep database clean they should be deleted always, not as an option. The same can be applied to the glossary example. Comments or ratings for entries that are deleted are not usable any more. Identically for userfiles, if posts or glossary entries are deleted, the files uploaded as attachments should be deleted (without option). Without a valid postid or entryid those files are not accesible anymore from within Moodle.
In other words, the right policy would be to _always_ delete records in other tables that depend on a given record being eliminated. Options should be used to ask teacher for data to keep or particular ways to manage teh existing option. In our current draft "options" are used more with a developer eye, to indicate what tables to touch.
I would appreciate any comments on this. In particular, usage examples and teacher-demanded options.