Lost backup

Lost backup

by Paul McCarthy -
Number of replies: 2

We backed up two courses (but didn't download) and merged one course into another.

We find that some of our files/folders did not get merged from the course that we merged into the other.

We cannot now find the backup

We have admin rights to our Moodle system but our backend database admin is outsourced. 

Is there a way we as user admins can retrieve and if not is the database admin likely to be able to retrieve the backup?




Average of ratings: -
In reply to Paul McCarthy

Re: Lost backup

by Ken Task -
Picture of Particularly helpful Moodlers

You will have to work with your DB admin person to find the location of backups.   Backups are in the sea of files in moodledata/filedir/ and no longer by humanly recognizable names nor filename extensions.

This query of the DB for your moodle will find all backup files:

select contenthash,filename,filesize from `mdl_files` where (`filearea` like "backup" and `filename` like "%.mbz%")

The contenthash value above shows the location of the backup file in moodledata/filedir/

Output of the query above looks like:

5f6aa594344ce919ce61ecba9d3b46035562e224 backup-moodle2-course-242-pre-ap_wg-20170525-1349-nu.mbz 9656127292
397f6305ea15ede0aeac4c48a65e07dffa3d153b backup-moodle2-course-40-forensics-20170525-1136-nu.mbz 2790158896

Let's say the first .mbz file listed in the above table is the one you want ...

It's contenthash 5f6a.... tells you that the file is located in:

moodledata/filedir/5f/6a/ and it's file name is 5f6aa594344ce919ce61ecba9d3b46035562e224

IF it was a teacher in the course that made the backup, login as that teacher and look in that teachers private files.

To work with that backup file, suggest copying it out to another directory and change it's name to something you can recognize.   I use a 'unirepo' file system to do that and command line ... you could use (with caution) any tool you might have to browse/copy files.

You might find an addon/plugin that will help:

https://moodle.org/plugins/index.php?q=backup

'spirit of sharing', Ken