Where is the backup area?

Where is the backup area?

by Visvanath Ratnaweera -
Number of replies: 5
Picture of Particularly helpful Moodlers Picture of Translators
I have a case of overflowing moodledata. Although the maximum upload limit is 100 MB there is a 1.2 GB file under moodledata/filedir. Its file type (as identified by Unix 'file' command) is "Zip archive data". I suspect it to be a backup of a course created by its teacher. It is ok to delete it, but I want to do it through Moodle GUI. How do I reach it?

I traversed the database and got the following results:
mysql> select * from mdl_files where contenthash='[contenthash]';
| id | contenthash | pathnamehash | contextid | component | filearea | itemid | filepath | filename | userid | filesize | mimetype | status | source | author | license | timecreated | timemodified | sortorder | referencefileid |
| 117176 | [contenthash] | [pathnamehash] | 5629 | user | backup | 0 | / | sicherung-moodle2-course-[coursename]-20190222-1228-nu.mbz | 1302 | 1197341183 | application/vnd.moodle.backup | 0 | NULL | NULL | NULL | 1550834946 | 1550834946 | 0 | NULL |

So I know the course name and the user. I can "Login as" that user (I am the admin). But how do I find the backup file area in Moodle web GUI and delete it?

Edit: Because of the urgency, I did it in an ugly way. Logged in as that user, went to the course and made a trivial backup. (Only a small portion of the course. Luckily I could gain some space by deleting data unrelated to Moodle.) After the backup I was shown the backup area where I deleted both backups. Need to know the official way of doing this.
Average of ratings: -
In reply to Visvanath Ratnaweera

Re: Where is the backup area?

by Ken Task -
Picture of Particularly helpful Moodlers

If I am understanding the question correctly, admins ability to have an easy tool to use to recover space has always been lacking.   If I am not mistaken it's been that way ever since I can remember.  So there is no 'official' way.   Think it has to do with private files which is hidden from admin level users - that's where you found that zip, correct?

What I do ... once I know the user id, login as, then do a 'fake restore' ... start the restore process whose first step is to find a backup file ... one then sees the 'private files' area and thus can delete - and save.  Then cancel the restore process.

Large site with space issue ... that is very time consuming.

This is where moosh might be able to help.  See: https://moosh-online.com/commands/

file-delete

That's why the admin makes the 'big bucks', right! smile

'spirit of sharing', Ken




Average of ratings: Useful (1)
In reply to Ken Task

Re: Where is the backup area?

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Ken,

I never got friendly enough with the Moodle repositories to understand their logic. So my explanation above may be broken. But think of this scenario: A teacher of a "voluminous" course takes a course backup. He may or may not downloads it, but leaves the backup just there - in the backup area, I guess. If the partition is almost full, it does not take much to break the site! That is exactly what happened.

What I did was a fake course backup as the teacher. At the end went to the course backup area, and cleaned both course backups.

Thanks for pointing out that Moosh is the correct tool for this. As you might have noticed, I am reluctant on "packaged" solutions, prefer to start with the basics. wink

Yes, this is a strong case for Moosh though.
In reply to Visvanath Ratnaweera

Re: Where is the backup area?

by Ken Task -
Picture of Particularly helpful Moodlers

When you think about it minute, teacher is doing the 'right' thing ... major assignment or work done, make a course backup.   That's a good safe practice.   What teachers don't really understand is Moodle is a shared resource

Have a teacher on one K12 system that teaches a Digital/Multimedia course.   Assignments are always large ... file wise.   After major assignments were due, teacher made a course backup, but didn't erase/remove older backups.   Eventually course got to 139 Gig.  Couldn't run autobackups.  And when a 1TB data got to 95% full before the end of an Academic calendar year (teacher had 6 older backups) with the Videos portion of this course yet to come, finally had to say something.  It did take 'peer pressure' for this teacher to adjust a little.

Was prepared to pull the trigger on moosh scripts if teacher didn't adjust ... for the good of all teachers/students in the system.   Since am a remote admin and not a member of that faculty/IT department they could always 'fire me' - but that would mean internal IT folks would have to become admins.

'spirit of sharing', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: Where is the backup area? [RESOLVED]

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Ken

Thanks for your insight. So in summary, Moosh is the only (technical) tool against this kind of data hoarding.

P.S. Sorry for the lack of general communication. I have said too much - I'm in eco-mode now. ;-X
In reply to Visvanath Ratnaweera

Re: Where is the backup area? [RESOLVED]

by Ken Task -
Picture of Particularly helpful Moodlers

Well, moosh isn't the only ... you already figured that out.  Moosh is, however, the only efficient and accurate way to re-claim space in a crunch.

And to be honest, a combo of web based admin and cli appears to me to be the most efficient and accurate way to admin a moodle.

My 2 cents, of course!

'spirit of sharing', Ken