Data Hub 2.0

Setting Up User Import Files

Setting up Import Files:

The fields that can be imported and exported are listed in the Field Mappings link. Go to the Administration block > Site Administration > Plugins > Local plugins > Data Hub plugins > Version 1 import > Field mapping.

Version 1 import field mapping link

The user properties mapping table enables you to map the names of user properties from your export file to properties in Data Hub.

Data Hub user field map
  1. The tabs at the top indicate which fields we are editing - in this example the User Fields.
  2. DH enables you to enter new values for these fields to match the values in your export file. For example if your backend system calls the username the uname, you can map the Moodle field username to uname here. The most common use here is to remap profile field values (see below).
  3. User profile fields added to the site are at the bottom of the list.
  4. Save changes to save your changes and put them into effect.

Changing the names of the Custom Profile fields in your export file:

Profile field editing

An example of the use of a common use of the field mapping interface is to match the import field names in the import file with the Moodle field names for custom profile fields. Since Moodle uses the profile_field_name format, DH's field mapping enables you to send Moodle "Company" from your backend system and DH will map that to Moodle's profile_field_Company format.

Any of these parameters can be set or updated via the DH import file. If you make changes to any property values, be sure to save your changes with one of the save buttons on the bottom of the screen.

Moodle custom user profile fields will be on the users property map. In DH Basic, the custom user profile fields all start with "profile_field_" then the shortname of the custom field, but this can be configured in the user property map.The following page has additional information about using custom profile fields.

The properties that can be set via the user csv files are listed below with brief descriptions:

action
The action field is always required. Enter create, update, or delete for this field. The actions from Data Hub 1 will work with Data Hub 2, "add" can be used instead of "create" and "disable" can be used instead of "delete".

auth: Enter the user authentication type here. The example below this chart has more information.

username: Username is a required field for user creation. This field is an optional identifying field, which are fields used to identify users for updating/deleting. For example, when updating a user I can include the action field, this field, and then add the fields that should be updated. This identifying field can be updated now.

password: Password is a required field for user creation.

email: Email is a required field for user creation. This field is an optional identifying field, which are fields used to identify users for updating/deleting. For example, when updating a user I can include the action field, this field, and then add the fields that should be updated. This identifying field can be updated now.

firstname: Firstname is a required field for user creation.

lastname: Lastname is a required field for user creation.

city: City is a required field for user creation.

country: The country name should be entered as it would in Moodle, e.g., United States.

maildigest: Enter no digest, complete, or subjects.

autosubscribe: Enter yes or no.

trackforums: Enter yes or no.

timezone: The user's timezone.

language: Check the Moodle site for the appropriate entries, use the shortname shown in parentheses. For example, English (en_us).

Description
Descriptive text about the user can be entered here.

theme: Enter the shortname of the theme.

screenreader: Enter yes or no.

description: Enter text.

idnumber
An idnumber from an external system. This field is an optional identifying field, which are fields used to identify users for updating/deleting. For example, when updating a user I can include the action field, this field, and then the fields that should be updated. The idnumber field can not be updated, once the idnumber field is set it can not edited with Data Hub.
institution: This is an optional field, located in the Optional section of the Moodle user profile.

department: This is an optional field, located in the Optional section of the Moodle user profile.

user_idnumber: The idnumber of an existing user. This can be used as an identifying field. If this field and the idnumber field are in the file, both values have to be the same because the idnumber can not be changed once set.
user_username: The username of an existing user. This can be used as an identifying field. If this field and the username field are present in the file, this will be the identifying field and the username field can then be used for updating.

user_email: The email of an existing user. This can be used as an identifying field. If this field and the email field are present in the file, this will be the identifying field and the email field can then be used for updating.

profile_field_fieldname: This is a custom profile field for the site. For this entry, enter "profile_field_fieldname" in the header, then add a value for this profile field in the column for the user.


Authentication (auth): Follow the steps below to find the value that should be entered for different authentications. This is not a required field, if a value is not entered then the default authentication will be used.
Manage authentication screen
  1. Go to Site Administration > Users > Authentication > Manage Authentication.
  2. Mouse over (do not click) the Settings link of the authentication type, this will display the url shown in step 3.
  3. The end of the url displays the name that should be entered as a value in the csv file, for example, "elisfilessso" should be entered for the ELIS Files SSO authentication.
The following list is showing the names of standard authentications and the entries that should be made for each authentication in the csv file.

Authentication Names CSV Entries
Manual accounts manual
No login
nologin
Email-based self-registration email
MNet authentication mnet
ELIS Files SSO elisfilessso
CAS server cas
Curriculum Management System Authorization crlm
External database db
FirstClass server fc
IMAPserver imap
LDAP server ldap
NNTP server nntp
No authentication none
OpenID openid
PAM (Pluggable Authentication Modules) pam
POP3 server pop3
Radius server radius
Shibboleth shibboleth


Required Fields


The required fields for creating new users are:
  1. action - the action field should always be listed first in the file
  2. username
  3. password
  4. firstname
  5. lastname
  6. email
  7. city
  8. country

For updating/deleting users the action field and one of the following three identifying fields are required:

  1. username
  2. email
  3. idnumber

Note: Username and email identifying fields can be updated now, the idnumber field can not be updated with Data Hub once it is set.


Data Hub Actions


DH tells Moodle what needs to be done with imported data via the Actions column. The following actions can be performed for users:
  1. create - create a user. Data Hub 1 uses "add" as the action, that will still work with Data Hub 2.
  2. update - update a user
  3. delete - this deletes the user and all of their data. Data Hub 1 used "disable" as the action, that will still work with Data Hub 2.
The sample file below illustrates this function, there is also a link to download this csv file below the image:
User file example

Select this link to download the sample CSV file used in the example above for creating/updating/deleting users.


The first column of the file contains the action field, which tells Data Hub to create, update, or delete the user. In the file the first two users are being created on the site. The third user is being updated. The fourth user is being deleted, which will delete the user and their records. The actions column enables DH to provide incremental updates, as well as enabling the updating or deleting of users via the automated process.

Password entries are required for creating users. If a user's password entry does not conform to your site's password policy the user will not be created.

User.csv file FAQ:

  • What if we send an empty file (no actions in that time period)?
    You will get an error saying that the file was empty, no users will be updated, changed, or deleted.

  • What does it mean to “disable” a user?
    Disabled users are deleted from the system.

  • How is the “add or update user” feature different than doing our own LDAP authentication?

    Data Hub supports user fields (such as custom profile fields) that are not supported by Moodle's LDAP plug-in.


* Requires that User themes are enabled in the Admin/Appearance settings of Moodle