unzipping .mbz backups

unzipping .mbz backups

by Ryan McKinnie -
Number of replies: 3

Hi everyone,


I have backed up a course into the .mbz file format and want to unzip and explore the files and folder structure. When I extract with RAR, I get unreadable files. I have Googled this problem and found a Python script that will use the .xml files inside the compressed .mbz to parse information and return a mirror image of the file structure from the original moodle structure. I am stuck now trying to run the Python code and get an output. Has anyone else encountered this issue? Any other workarounds?

Attachment moodle ish.JPG
Average of ratings: -
In reply to Ryan McKinnie

Re: unzipping .mbz backups

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Gee, haven't done this for a while.... but what used to work was 

1. Rename the file to a [finename].zip 

2. Unzip using 7Zip, or Winzip or any zipping program.

3. Edit the files but unless there was a reason to, leave the .xml file alone. Have done it and it worked but not really what I wanted to do. 

4. Zip the file up again

5. Rename to an .mbz file. 

6. Upload the file as a restore a backup to my test site first, then to the production site . 

Just had a quick run through and seemed to work... but, to be honest that was not on a recent backup. 


In reply to Ryan McKinnie

Re: unzipping .mbz backups

by Dave Balch -

FYI, the .mbz backup files have actually been .tgz (gzipped TAR) files since M2.9.

I'm not sure if that makes a difference though - I would expect any archive program to handle .tgz files correctly.

Average of ratings: Useful (3)
In reply to Dave Balch

Re: unzipping .mbz backups

by Bob Belz -

Thanks, it is tgz in 3.5.2. On mac (or Linux) command line this unzipped into a folder

$ cp backup-course-20190417-1105-nu.mbz backup-course-20190417-1105-nu.tgz

$ mkdir course_backup

$ tar -xzvf backup-course-20190417-1105-nu.tgz -C course_backup