Deleting legacy course files

Deleting legacy course files

by alison fordham -
Number of replies: 6

Somehow multiple courses (30 plus) have ended up with duplicated legacy course files from one course - Am I correct in thinking I will have to delete them one by one in each course? I don't know how this happened and need to backup and restore them without the legacy course files.

Average of ratings: -
In reply to alison fordham

Re: Deleting legacy course files

by ben reynolds -
It's been several years since we took legacy files out of courses, but my shakey memory is that I check all the files in a folder and delete them all at once. Then the folders. Oh, I see you mean one by one in each course. Probably, unless you have access to the database and some really good instructions from somebody who knows how to manipulate it.
Don't forget to uncheck Legacy Files in Course Settings before you back up!
In reply to alison fordham

Re: Deleting legacy course files

by Ken Task -
Picture of Particularly helpful Moodlers

If course backups were from older moodles legacy setting was probably present ... no warning on restore.  And once a course was in legacy it was in legacy forever ... only fix ... redo every module.   But then someone offered a plugin called 'poof' ... an editor addon ... but same issue in that one had to visit each module that had legacy and use the 'poof' button in the editor to 'tag' that resource in 'draft' ... which later via cron/whatever would be move to 'something normal'. (for lack of known 'technical term').

I discovered what poof was doing and, like others, didn't wanna have to visit each to fix, instead a way to get as many as I could to 'draft'.    Thus, created something I call 'clipoof'.

Can read about it:

https://sos.sosoftexas.org/scripts/clipoof/clipoof-notes.txt

and acquire by changing the end of above URL to:

clipoof.zip

Script requires sed and tar - so linux only.

And one has to have a backup .mbz file (the one in legacy) to work with + space enough to do what it does.

Once converted, backup file whose name has now changed, used in a restore process.

So that one doesn't have to do a lot of downloads only to turn around and upload, one could set up a clipoof file system repo where the scripts and .mbz files would reside to make it easier to restore to server.

While I have tested and used ... it works on my systems ...  offered as is ... but don't mind someone asking questions about it.

'SoS', Ken


Average of ratings: Useful (1)
In reply to alison fordham

Re: Deleting legacy course files

by Justin Hunt -
Picture of Particularly helpful Moodlers Picture of Plugin developers
If the courses are not using legacy files, can't you just turn off legacy files in the course settings and then do your backup and restores? [I am hazy on how all that worked now though.. ]
I would just bite the bullet and rid the original course of legacy files and then empty the legacy files directory forever. Otherwise its like sleeping knowing there is cockroach somewhere in the room. Perhaps you have a reason to not do that.

FWIW I am the one that made "poof" .. its here:
https://github.com/justinhunt/moodle-tinymce_poof
In reply to Justin Hunt

Re: Deleting legacy course files

by Ken Task -
Picture of Particularly helpful Moodlers

Thanks for creating 'poof' ... used it ... worked like a charm.

Both of us are having to try and re-collect those days of old ..

From what I re-call, if one turned off Legacy Files in a course, that would not hide/remove resources/links to files etc. in the course itself ... thus would be included in the backup file.

I my test of clipoof, ran clipoof on a backup that had legacy files, restored that course with the clipoof backup .mbz file.  Course restored just fine but present in course admin menu was the link for Legacy files.   Turning off was ok to do with that course because it really wan't using Legacy files.   Everything did work with it off.

Agree that it is worth biting the bullet and getting courses out of legacy ... by whatever means.

'SoS', Ken