For the online learning world


Data and E-Learning Part 7: Extracting data from Moodle

Throughout this series we have looked at ways you can use data from your Learning Management System (LMS). In the next three articles we will look at ways you can get data out of a Moodle LMS and what you might do with this data. In this article we will look at exporting participant data.

File types

You will usually be given some options when downloading data for the type of file to export the data as. The two file types you will most commonly be interested in are Comma separated values (.csv) and Microsoft Excel (.xlsx). Both file types can be opened and viewed using Microsoft Excel. Which file type you export to will depend on what you want to do with the data.

Microsoft Excel (.xlsx)

.xlsx files can be opened and edited using Microsoft Excel. This file type is appropriate if you will only be working with the data within Microsoft Excel. It is a good file format if you just want to look at the data or if the analysis you will be performing can be done within Microsoft Excel. Any changes you make to the data such as formatting will be kept if you save the file and then reopen it. .xlsx files are less suited for use within software programs or when using programming languages such as R or Python.

Comma Separated Values (.csv)

.csv files are useful if you will be loading the data into some analysis software or if you will be working with the data using a programming language such as R or Python. You should use .csv files if you plan on performing analysis on the data that goes beyond what can be done in Microsoft Excel or if you plan on combining multiple datasets. Note that any formatting changes you make to a .csv file using a program like Microsoft Excel will be lost when you close the file (even if you save it).

It is not recommended that you open .csv files using Microsoft Excel. This is because any leading zeros in the data may be dropped which can lead to corruption of your data. To look at a .csv file in Microsoft Excel it is recommended that you make a copy of the file first. Open this new file in Microsoft Excel to view it. A better option would be to open it in a program such as Notepad or Notepad++ as this will prevent the leading zeros being dropped.


We will be using the Moodle Demo site for the examples in this article. Your site will probably look different and you may need to tweak some of the steps provided to extract the same data. Use the examples as a guide to apply to your own situation.

Participant data – full site

One dataset you will use often is the full set of users in your LMS. This can be very useful for managing your students and for combining user data with other data that you extract from your LMS. This can help you to answer questions related to specific users. Let’s look at how to extract the full user data from a Moodle installation.

Extracting participant data

You can download the user data for your full LMS as follows:

Click Site administration (1) in the left menu and then click the Users tab (2).

Click on Bulk user actions.

Click Add all.

In the dropdown box select Download (1) and then click Go (2).

Select to export the users as Comma separated values (.csv) (1) and then click Download (2).

Data contents

This process will download a .csv file with the user data for all users in your LMS. The exact data available will depend on how your Moodle installation is set up but will probably include the following:

  • id
  • username
  • email
  • fist name
  • last name
  • idnumber
  • institution
  • department
  • city
  • country.

Using the data

So what could you do with this dataset? That is a question I want you to answer based on your own situation. Here are some ideas to get you started:

  • Send an email out to users in a specific city regarding an upcoming meetup
  • Run some analysis on which cities and countries your users are from
  • Randomly select a pool of users to survey
  • Add the country data to grade data so that you can analyse performance by country.

Have a go at pulling down the user data from your LMS. Please be wary of any privacy concerns with the data you pull down and be sure to store it securely and delete it when you no longer have a use for it.

In this article we have looked at pulling down all user data from a Moodle LMS. This will be a valuable step for a range of data analysis tasks that you could perform based on your LMS. In the next article we will look at how you can pull down data from the grader report.

You can view the previous posts in this series here:

Jeff Mitchell
Latest posts by Jeff Mitchell (see all)

Jeff Mitchell

Jeff is passionate about the role of learning and development, and has a specific interest in how people and organisations can be developed in order to achieve their potential. Jeff has a keen interest in information technology and specifically data analysis and the e-learning space.

2 thoughts on “Data and E-Learning Part 7: Extracting data from Moodle

Add a reply or comment...