Skip to end of metadata
Go to start of metadata


There has been interest expressed by a number of people to be able to import moodle data into Sakai, currently there are no known Sakai import implementations for moodle. If you know of one or are interested in helping write one please send a note to

Current work

The beginnings of a moodle export file parser for moodle 1.4 have begun at

A 1.5.3+ parser has also begun at This parser does not extend the IMS parser applied to Bb and WebCT migration efforts. At this writing (Jan 11, 2008) it is limited to web links and file resource import.

The differences between exports from a number of versions of moodle are small enough that there could be a single parser that handles many of them.

The Moodle Course Export Format

Moodle exposes features for site- (i.e. installation) and course-level backup/export. For our purposes, we're interested in the archives generated by course-level backups. End-user documentation of the backup/restore process is available at the folllowing locations:

Based on examples provided by ASU, Moodle's course exports are zip archives having the following structure:

/ --
  course_files/  <-- binaries (sometimes) referenced by objects in manifest
  group_files/   <-- purpose unclear
  moddata/ --    <-- seems to contain activity-specific files, e.g. forum and assignment binaries
            assignment/ --
                         [some-number]/ --   <!-- large quantity of these
                                         [some-other-number]/  <!-- large quantity of these, most containing one binary file
            forum/  <-- layout identical to ../assignment/  
  user_files/    <-- purpose unclear; presumably end-user owned files rather than course content
  moodle.xml     <-- archive manifest

The manifest schema (moodle.xml) does not appear to be documented outside of code.

Tools can generate schemas from moodle.xml instance documents, but the MIG:results aren't particularly useful in terms of trying to grasp the semantics of a given manifest and implement Sakai mappings.

Generally, though, manifests seem to take the following (heavily abbreviated) form, based on a review of manifests generated by Moodle 1.6.1 and 1.5.3+.

(Confluence is not happy with the size of this page if the entire example is inlined.)

  <INFO>INFO Example</INFO>




    <USERS>USERS Example</USERS>







A Note on Moodle URLs

As mentioned in several locations in the examples above, Moodle content descriptors frequently reference each other, sometimes with absolute URLs, and sometimes with macro-encoded urls. For example, instead of, we'll see $@FILEPHP@$/science_1.jpg. Parameterized macros include an ID reference to some content object. For example: $@WIKIVIEWBYID*48468@$. Here's the list of macro's encountered so far:






Presumably expanded in Moodle to

where XXXX is the course ID



Typically used to encode whitespace in manifest XML without resorting to HTML. Seems to be common in Wiki descriptors.

















The following URL formats are also of interest:



Meaning unclear. Int value does not correspond to an object defined by the archive manifest.

Seems to link to the default course view, navigating to the section who's ordinal is "1"

Presumably an expansion of $@FORUMVIEWBYID*42111@$. The interesting thing about that URL is that in the archive from which it was taken, it actually seems to reference the module's placement in a section rather than a module directly (/MOODLE_BACKUP/COURSE/SECTIONS/SECTION/MODS/MOD[MIG:ID = '42111'] rather than /MOODLE_BACKUP/COURSE/MODULES/MOD[MIG:ID = '42111'])


This reference was found in an assignment definition (/MOODLE_BACKUP/COURSE/MODULES/MOD[MIG:MODTYPE='assignment']/DESCRIPTION). The relative navigation makes sense if we assume an assignment's URL takes the form /moodle/mod/assignment/view.php?id=XXXX. In this case, 1789 is the course ID. More interestingly, "workshopnine" is a valid anchor name because it is part of the markup inlined in a section summary (e.g. /MOODLE_BACKUP/COURSE/SECTIONS/SECTION/SUMMARY: "<a name="workshopnine" id="workshopnine"></a>
<font size = "+2" font face="Arial, Helvetica, sans-serif"><em><strong>Wrapping It Up!</em></strong><p>"

Sample exports

A fairlly simple export sample for moodle 1.4.3 + (2004083131):

  • No labels

1 Comment

  1. Where would such an importer sit? Is the importer intended to forward generate a set of worksites populated with resources and forum entries ?