In reading the post Rick linked to:
"
The risk of a TRUNCATE TABLE is to your records-keeping and data retention requirements."
@Veronica ... what are those requirements for you site?
Have any hidden courses that are not active?
I am able to do more on a K12 site due to usage and requirements.
Quick summary:
After classes are over for an academic session and grades have been posted in their official grade book (not moodle's), teachers reset their course ... and make sure the option to remove the student role and the students work in the reset.
I check using the who done it that all teachers used reset on their courses. If they didn't, I do it. :|
Reset removes student accounts, their work, their history/records in that course.
Since site uses
LDAP, they eventually remove graduating students from their LDAP - I don't have to do an LDAP sync as the student accounts will expire by themselves ... lack of use.
Check things using moosh commands and do cull orphaned files.
Like many things in moodle, there is a beginning ... and if there were just a few more things added to allow finer tuning or selection, would be great. But, alas ... not yet ... so that's where things like direct DB manipulation and command line utilities like moosh come into play - using those very carefully, of course.
And, if one does such things, a backup is required for safety net.
'SoS', Ken