mbex is a tool to extract module information from a Moodle backup file (.mbz).
Contents
Description
Moodle is one of the most popular Virtual Learning Environments used in colleges, universities and institutions around the world. It uses a special file type (MBZ) to create backups for your projects.
mbex (Moodle Backup Extractor) is a tiny tool that extracts content from MBZ files.
It extracts the following:
- The structure of the module (sections)
- The description of the sections
- Files
- Labels
- URL
- Assignments, submissions and grades
- The description of the activities and resources
Screenshots
Fig 1: The main form of mbex
Fig 2: The folder structure of the extracted content mirrors the structure of the Moodle page
Downloads
mbex-Win32-1.4.0
Release Notes
Known Issues
Long folder and file names
mbex exports the activities and files in a folder structure that resembles the organisation of the course on Moodle. An example of it can be seen in fig. 2.
The issue with this approach is that all major operating systems (Windows, macOS, Linux) have a limitation on the length of path and file names. On Windows, there is a way to bypass this limitation but there is no guarantee that the extracted file will be readable. It depends on the installed version and updates of Windows.
As Moodle is used by millions of people around the world following different conventions and preferences for naming resources, it is impossible to impose limitations or predict the length of the exported path. Therefore, when mbex attempts to replicate the structure of a course in folders and files, there are cases where it reaches the limitations of the operating system and generates an error.
In order to mitigate this situation, v.1.4.0 introduces an additional option to name exported folders and files that uses generic names for folders and files (Section, Resource). The option can be found in the “Export Options” tab on the main screen.
As an example, let’s assume a course is called “An introduction to the complexity of long folder and file names on Windows”. This course has a session called “Historical and cultural reasons that led to the limitations people in the 21st century are facing with long folder and file names”. In this session, let’s assume there is a PDF file called “Bill Gates on what made him choose hard limits for long file and folder names on Windows 3.10 and why Jobs and Linus followed suit: a necessity or a preference?.pdf”.
Let’s also assume the exported file will be saved in “C:\Windows\Users\mbex\Desktop”.
Typically, mbex will attempt to create the PDF file at this location:
- c:\Windows\Users\mbex\Desktop\An introduction to the complexity of long folder and file names on Windows\Historical and cultural reasons that led to the limitations people in the 21st century are facing with long folder and file names\Bill Gates on what made him choose hard limits for long file and folder names on Windows 3.10 and why Jobs and Linus followed suit: a necessity or a preference?.pdf
…and, typically again 😥 , it will fail because the full path is 399 characters long; this is above the 255 character limit on Windows.
When mbex uses generic names, the exported file will be saved in
- c:\Windows\Users\mbex\Desktop\An introduction to the complexity of long folder and file names on Windows\001 – Section\001 – Resource.pdf
…which counts 137 charactes. mbex will increase the two numbers according to the number of extracted sections and resources. Additionally, a file will be created with the mapping of the generic names to the original ones.
In summary, there are three ways to deal with long names:
- Extract the content with the default settings: If all works well, then great 😉 . If you see errors and warnings in the extraction form, check the log to identify which resources have not be extracted. You may be able to download them directly from Moodle if they are not that many
- Change the output folder: Change the output folder to a shorter path (e.g., c:\exports) and try again
- Extract the content using generic names
Licence
mbex is not free for every use.
- If you are a freelancer you can use the tool free of charge for your own Moodle courses
- If you wish to use mbex in your institution, there is a license fee. For more information, get in touch here: contact@kouraklis.com
Comments and Feedback
Please forward any comments or feedback to contact@kouraklis.com
Features and Bugs
If you have an idea about how mbex can be improved or have spotted a bug, please report it using one of the following ways:
- Add a comment below
- Send an email to contact@kouraklis.com
Buy me a Coffee
Software takes time and effort to develop.
Why don’t you buy me a coffee as a small gesture of appreciation?
Thank you.
Dear John,
I have tried mbex to extract mbz files. However I have the issue that if a file is saved in multiple languages under the same file name, the files are overwritten, so instead of 10 files there’s only one exported. Is there a way to extract the files with the activity name? (-> in local language)
Thank you very much,
Timo
Hi Timo,
Thanks for trying mbex.
Can you please provide an explanation of what happens? FOr example, how are the activities organised on Moodle?
I haven’t tried mbex in multiple languages. TBH, I never thought that it will be an issue. If you provide some details, or even better if you can create a moodle backup with example activities and send it through, I will look at it.
Thanks.
John
Hi Timo,
I released a new version and fixed the issue. Check the change log for more details.
Thanks for reaching out.
Hey, I’ve been trying the tool and it seems to read really well the content, but it fails to extract them, had the same issue with another script, it seems that the name of the course name is too big and when trying to export it says that the extract directory name is very long.
I don’t see an option to change the extract directory names, I assume it takes the name of the course. Do you have any idea on how can I give the export name as an option here? thanks for the help, amazing tool.
In the tool I just get a “error” message without information
Hi,
Thanks for the email.
I emailed you separately.
Hi does it extract quiz answers as I am trying to extract answers to the quiz module and no extract button shows
Hi,
I will email you separately about this.
Thanks