Archiving Data from Moodle

Archiving Data from Moodle

by Dan Stimson -
Number of replies: 4

Is there a way to automatically archive data from Moodle which is older than a certain date?  We would like to be able to remove the learner assignments which were uploaded to Moodle more than 4 years ago.

Thanks for your help

Average of ratings: -
In reply to Dan Stimson

Re: Archiving Data from Moodle

by Ken Task -
Picture of Particularly helpful Moodlers

Pardon my dumb question, but what (exactly) do you mean by 'learner assignments'?

Are we talking about courses that are more than 4 years old?

OR

are we talking actual assignments in courses that are more than 4 years old?

If A, could move those 4 year old courses to a category called 'dump' and then remove the cateogory ... which could be massive an intensive for the server.

If B, don't think so ... assignments, if the courses in which they reside have not been reset, contain students work and probably associated with grades, etc..   So rather complicated, I would think, to dump them with 'an easy button'.

Am not a Moodle Guru ... more like the lowest 'order' ... that to say, maybe someone has done exactly what you want and they will respond. ;)

'spirit of sharing', Ken



In reply to Ken Task

Re: Archiving Data from Moodle

by Ken Task -
Picture of Particularly helpful Moodlers

Correction ... you wanted to archive and I was talking 'dump'. [duh!  Can't read today!]

Once you've ID'd the courses to archive, move them all to a category named such ... archive.

Then investigate the approximate course sizes ... there is a plugin that might help called course size.

If you have enough room for storage, one could use the command line script in moodlecode/admin/cli/ called backup.php and use the cid numbers with a destination directory (where you have space) and back them up.

If you cd /moodlecode/admin/cli/

then issue php backup.php that will bring up a help screen with the options.

Have a bunch ... then could use a bash shell script to loop through a test file that contains the course ID's in the archive category as well as the common destination directory.

'spirit of sharing', Ken


In reply to Ken Task

Re: Archiving Data from Moodle

by Dan Stimson -

Hi Ken

Many thanks for your advice, I will definitely use our test environment to have a go at moving an obsolete course to another category and then dumping or archiving.  However, we do have a lot of uploaded work associated with our courses which has been submitted by learners and then marked by assessors, do you know whether removing  the course will also remove any linked coursework files? is there anyway to clear out old assignment files while leaving the original course in place?




In reply to Dan Stimson

Re: Archiving Data from Moodle

by Ken Task -
Picture of Particularly helpful Moodlers

Archive first ... those would be full backups of courses ... users, students, their assignments, etc.  Then copy those archives off onto another server for storage.

Think you need to read up on 'reset' of courses.

https://docs.moodle.org/33/en/Reset_course

In the newer versions of Moodle when looking at what to reset in each course, turn down/open each option - reason - easy to miss the student options to remove not only students but their work while resetting a course.

Do one or two like that, then see the results.  Once you get that down the way you want, it's easier going forward.

'spirit of sharing', Ken