Skip to content
MoodleFiles

Get every file out of a Moodle course backup under its original name

A Moodle course backup stores each uploaded file under a hash, so the files inside have names like 43/43aa2e4a... and no folders. MoodleFiles reads the .mbz backup in your browser, restores every file under its original name and folder, and gives you a ZIP plus an index.csv with the path, size, type and hash of each file. Nothing is uploaded.

Preview your files

Free preview US$4 per course backup

Files stay on your device. No account needed.

moodlefiles-demo.mbz (one course backup)moodlefiles-demo.mbz
Moodle course backup
Records in files.xml
12
Folder records
5, skipped
moodlefiles-demo-files.zip (5 files + index.csv)Sample result
5 course files restored5 folder records and 1 repeated record skipped1 listed file missing from the archive

Moodle course backupYou upload

Original files + index.csvYou download

PrivacyYour file never leaves your device

Five files restored, one listed file reported as missing

What makes this file tricky

A Moodle course backup keeps every uploaded file as a hash inside a files folder, and the names and folders are only in files.xml. Teachers who want their lecture slides, handouts and data back from a backup have to match hashes to names by hand, and a backup with a few hundred files is not practical to rebuild that way.

What the tool accepts

Reads Moodle 2.x and newer course backups: a gzip-compressed tar (.mbz, .tar.gz) or an older ZIP with files.xml at the top and the hashed files/ folder. Only files.xml and files/ are used. Course structure, activities, grades and the rest of the backup are not converted. Each file goes back under the filepath and filename that files.xml lists; the component and file area do not make folders. Folder records and repeated records of the same file in the same folder are skipped. A file that files.xml lists but the archive does not contain is reported and not restored. Backups made with user data also include student uploads, and those are restored too. Moodle 1.9 backups and encrypted backups are not supported. Names with characters Windows does not allow are changed to underscores. Checked against a generated backup with the same files.xml layout and hashed folders, not a backup from a live Moodle site. Up to 1 GB, read in browser memory.

From source file to export

  1. Open the source file

    In Moodle, open the course, go to Course administration, choose Backup and make a backup with the default settings. Download the backup file from the course's backup area and keep its .mbz name.

  2. Check your preview

    Choose the .mbz file here. The preview counts the files, the folders, the repeated records and any file the backup does not contain. Nothing is uploaded.

  3. Save the export

    Download the ZIP. Its folders match the course folders, and index.csv lists the original path, size, type and hash of each file.

Read the step-by-step guide

Open MoodleFiles

Try a sample or open your own files. The preview runs in this browser.

Source files

Moodle course backup

No files selected.

Preview & export

Original files + index.csv

Choose a file or try the sample to see the result here.

What the sample produces

The sample is a small course backup written by a script, with folders, a file name that contains an ampersand, a repeated record and a file listed without content. The check reads the same backup with Python's tarfile and xml.etree, compares the SHA-256 and size of every restored file, and checks each row of index.csv. The same files were also tested as a plain tar and as an old-style ZIP backup.

moodlefiles-demo-files.zip (5 files + index.csv)

Course files restored
5, under their original folders
Rows in index.csv
5, one per restored file
Listed but not restored
1, reported in the preview

MoodleFiles and other ways to do the job

Comparison of MoodleFiles and other tools
ToolWhat it does
MoodleFilesThe sample is a small course backup written by a script, with folders, a file name that contains an ampersand, a repeated record and a file listed without content. The check reads the same backup with Python's tarfile and xml.etree, compares the SHA-256 and size of every restored file, and checks each row of index.csv. The same files were also tested as a plain tar and as an old-style ZIP backup.
MBZ Moodle RestoreMIT-licensed Windows app on SourceForge that restores the original file names from a Moodle backup; it has to be downloaded and installed on Windows.
mbex (Moodle Backup Extractor)Windows program that extracts module content and files from MBZ backups; the unregistered version shows a nag screen.
zeehio's Python scriptPython script on GitHub Gist that copies the files of an unzipped backup into the original folder tree; Python must be installed and the backup unpacked first.

The links describe each alternative's documented workflow.

Preview for free. Pay when you download.

Free preview

$0

Open a sample or your own files and inspect the result before deciding whether to export.

Full export

US$4 per course backup

Pay once to download the full result shown in your preview.

Already paid? Restore your purchase.

Frequently asked questions

Does it work with any Moodle version?

It was built for Moodle 2.x and newer backups, which keep files.xml and hashed files in the same layout. Moodle 1.9 backups use a different layout and are not supported. The sample is generated, not a backup from a live site, so check one of your own backups before you rely on it.

Does it include student uploads and grades?

It restores the files that are in the backup. A backup made with user data includes student uploads, and those are restored. Grades and the course structure are not converted.

Does it upload my course or change Moodle?

No. The backup is read in your browser and nothing is written back to Moodle. The ZIP and index.csv are new files that you download.

How much does MoodleFiles cost?

The preview is free. Each course backup is US$4, charged once at download.

Do my files get uploaded?

Your files are processed in your browser. Stripe handles checkout separately.

Do I need an account to pay or download?

No account is needed. Complete Stripe Checkout and return to this browser to download the result.

Can I come back to finish a paid download?

Open this tool in the same browser and select Restore purchase. Prepared exports are kept locally for up to seven days.

Guides and support

Try MoodleFiles with a sample

Open the tool and preview the result for free.

Open the tool