- Data Hub Overview
- New Data Hub Features
- Accessing Data Hub for Moodle 2
- Data Hub Configuration
- Importing/Processing Files
- Viewing Logs
- Accessing the Import, Export, and Log Folders Via SFTP
- Setting Up User Import Files
- Updating User, Course, and Enrollment Information
- Using Custom Profile Fields
- Importing Course Information
- Importing Enrollment Information
- Exporting Grade Information from Moodle via DH
- Importing very large user and enrollment files:
- Automating Data Hub
- Full list of actions and required fields for each
Data Hub 2.0
Setting Up User Import Files
Updating User, Course, and Enrollment Information
Updating with Data Hub:
When updating accounts, you don't need to have as much information in your CSV file as you do when creating accounts. The required information for each entity is described in the following table.
Updating: |
Required |
Notes |
Users |
username or email or idnumber |
You only need one of these identifying fields to update a user. Note that idnumber field can not be updated, the username and email fields can be updated now, see details below. |
Courses |
shortname |
You only need the Moodle course shortname to update a course. |
See the Full list of actions and required fields for each page below for more detailed information on what commands to use for creating/updating/deleting items and enrollments.
Updating User Identifying Fields
The username and email field can be updated. The idnumber field can not be updated once it has been set. There are a couple of ways to update these fields, the following use cases will demonstrate different ways to update the email field.
Use Case 1
For this example we will use the Data Hub settings to update a users email. Go to the Administration block > Site Administration > Plugins > Local plugins > Data Hub plugins > Version 1 import. The following image shows the screen that will open. Deselect the checkbox that controls whether the email address is used as an identifying field.
Now email addresses can be updated in user import files, but the email address can no longer be used as an identifying field. The following image shows an example of a user import file for updating a user's email. The 'idnumber' field is the identifying field and the 'email' field is being updated.
It is possible to keep the email field as an identifying field and update the email field, that is demonstrated in Use Case 2.
Use Case 2
For this second use case we will use the new fields added to the Version 1 import user field map. In this use case we do not need to edit the Data Hub settings for identifying fields, all three identifying fields are active in this use case. The following image shows the bottom of the User field map located in the Administration block > Site Administration > Plugins > Local plugins > Data Hub plugins > Version 1 import > Field mapping > User Fields tab.
When these new fields are added to the file they become the default identifying fields and the standard identifying fields can then be used for updating. Here are two example files that demonstrate how to set this up.
The first one will use the 'user_idnumber' field as the identifying field and the 'email' field is being updated.
The second file will use the 'user_email' field as the identifying field and the 'email' field is being updated.
Note: The 'idnumber' field can not be updated once it has been set. If a file has the 'user_idnumber' field and the 'idnumber' field both values have to be the same.