Critical Request: How to restore an MBZ file to recover a course

Critical Request: How to restore an MBZ file to recover a course

by John Reese -
Number of replies: 1

Hello,

This is related to my post: https://moodle.org/mod/forum/discuss.php?d=221052#p962044

We back up our database and moodledata on a nightly basis and because we have encountered a critical error, we would need to recover and restore the course from a previous backup.

How do we restore a course from a backup when we know what the name of the backup is in our mdl_files.filename table?

Where do we grab the backup from our /srv/moodledata folder?

is this correct?

select contextid, contenthash, pathnamehash, filepath, component from mdl_files where contextid = 'xxxxxx' and component = 'backup';

and then just do a find for the pathnamehash and then the cotenthash is the mbz file?

Thanks

 

 

 

Average of ratings: -
In reply to John Reese

Re: Critical Request: How to restore an MBZ file to recover a course

by John Reese -

Interesting and scary what I found ...

Just did another query to try and see what backups the course has and it’s gone also the database side too after today’s error ..could mean that it may be harded to try and find the backup now after the error occurred.

All I can hope now that it's still somewhere in our moodledata folders but just not recorded in the database.

Perhaps I should restore the database to a test platform to get that file location and then check to see if it's still there in the production moodledata directory.

thoughts?