mbex is a tool to extract module information from a Moodle backup file (.mbz).
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
- Assignments, submissions and grades
- The description of the activities and resources
Fig 1: The main form of mbex
Fig 2: The folder structure of the extracted content mirrors the structure of the Moodle page
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
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: email@example.com
Comments and Feedback
Please forward any comments or feedback to firstname.lastname@example.org
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 email@example.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?