Developer Area/Import//Export

From Mahara Wiki

< Developer Area
Revision as of 15:22, 2 October 2020 by Cecilia (talk | contribs) (How do I use it?)

In Mahara, import and export refer to the ability for users to export their portfolios (or parts of them), and then to import them again. This system is designed to allow transfer of all manner of portfolio information in to, and out of, Mahara.

In early 2009, Mahara took part in a JISC CETIS project called PIOP - Portfolio Interoperability Projects. The goals of the project involved implementing import and export of data using the LeapA standard. Mahara took the opportunity to add generic import/export APIs to allow other formats to be integrated in future, as well as implementing a standalone HTML export plugin and fully integrating the work into the UI.


Full Leap2A import and export support is included in Mahara 1.2. You can fully export and import portfolios between Mahara installations. Some preliminary results are available regarding interoperability with the other PIOP partners. You can watch a video demonstration of the import/export functionality:

How do I use it?

In Mahara we have the possibility to export and import individual portfolios or a whole account. The different ways we can do this will depend on whether we are logged in as site administrator or not.

A site admin is able to import and export many accounts at once by using the admin bulk tools:

  • To do a bulk export
  1. access this URL <sitename>/admin/users/bulkexport.php
  2. You'll see a form with a field 'Users to export'
  3. Fill in the usernames of the accounts to export, each one a new line and export
Bulk export page
  • To do a bulk import
  1. access this URL <sitename>/admin/users/bulkimport.php
  2. You'll see a form where you'll need to fill the 'Bulk export file' field with the exported accounts to be added to the site. The file used here has to be one obtained by doing a bulk export on the same or a different site.
  • A site admin can import one single account manually as well:
  1. By going to Admin menu -> People -> Add person, we get a form that allows us to manually add a new account.
  2. On the first step we can add the details by filling up the fields, or check the Leap2A import and attach a file containing an account details. The files we can user here can come from a simple account export done by the owners account or take one of the zip files inside of a bulk export (you'll have to unzip the bulk export to get it, there should be one for each account exported)

A common user is able to import and export their whole account or some of the portfolios

  1. Main menu -> Manage -> Export: Where we can export the account or portfolios
  2. Main menu -> Manage -> Import: Where we can import the files exported form the same or different site, containing an account or just a few portfolios

IMPORTANT note for developers: When modifying a blocktype, view structure or artefacts, or anything that needs to be added to an export when exporting an account, the tests should contain all of these export/import alternatives. Some of them follow a different path on the code because they can be imported following a different strategy. For example, a bulk import will be non interactive while a personal portfolio import will let you choose what artefact/portfolios from the file to import.

Meeting Notes

For the meetings we had during development.