Moonami has developed a plugin called NexSIS that makes it easy to sync student, course, and enrollment data from an external system to your Moodle site. The external system is commonly a Student Information System (SIS), but it can be any system that can export data in comma-separated value (CSV) format, as NexSIS only accepts CSV files.
Once your SIS is integrated with your Moodle site via the NexSIS plugin, the process of syncing data from one system to the other looks something like this:
- Your SIS exports up to three CSV files: one for users, courses, and/or enrollments.
- You send the CSV files to a Moonami server that handles NexSIS integrations.
- Your Moodle site detects the CSV files, updates the site with their content, and archives the file(s).
This process can be entirely automated and set to run at regularly scheduled times. Once you complete the initial configuration of the integration, you can let it run automatically and put it out of your mind.
CSV file specifications
Before you send your CSV files to Moonami’s server, you’ll need to make sure the files are in the proper format. Each of the three types of file has a certain set of required fields that must be included, as well as optional fields that may be included. The order of the fields does not matter. Each file must contain a header row that lists the column headings.
You can change the default settings for these files (including file name, delimiter, and available actions) from the NexSIS plugin settings on the Moodle site. You can get there by going to Site Administration > Plugins > Enrolments > NexSIS and choosing the Files tab.
You will find sample files attached to this document that you can use as templates.
The default name for this file is “users.csv”. Every row in the file defines a single user. The required columns for the users.csv file are:
|action||The action to be performed on the user record, e.g. “add” or “delete”.|
|userid||The external system identifier for the user to create, update, or delete.|
|username||The Moodle username for the user.|
|firstname||The user’s first name.|
|lastname||The user’s last name.|
|The user’s email address.|
You may also include any other fields available on a user’s profile page in Moodle (including custom profile fields), but these other fields are optional. To determine the appropriate names to use for the column headings in the CSV file, you can download a CSV file with the correct headings for all fields in a user’s profile by going to Site Administration > Users > Bulk user actions, selecting at least one user, and choosing “Download” from the list of user actions.
A sample users.csv file might look something like this:
action,userid,username,firstname,lastname,email,auth add,STU3141,samsmucker,Sam,Smucker,[email protected],ldap delete,STU3176,sallysitwell,Sally,Sitwell,[email protected],ldap ...
The default name for this file is “courses.csv”. Every row defines a single course. The available columns for courses.csv are:
|action||Yes||Action to perform on the course record, e.g. “add” or “delete”.|
|courseid||Yes||The external system identifier for the course to create, update, or delete.|
|fullname||Yes||The full name of the course.|
|shortname||Yes||The shortened or abbreviated name for the course.|
|startdate||No||The start date and time of the course (in datetime format).|
|enddate||No||The end date and time of the course (in datetime format).|
|categorypath||No||Where this course belongs in the category hierarchy (in URI format).|
|format||No||Moodle course format to use for the course.|
|templateid||No||The identifier of a course template or shell to use when creating the course for the first time in Moodle.|
A sample courses.csv file might look something like this:
action,courseid,fullname,shortname,startdate,categorypath add,C554,Introduction to Psychology,PSYC101-01,2020-08-20T21:00:00:00,/Psychology delete,C802,Artificial Intelligence II,COMP304-01,2020-08-20T21:00:00:00,/CompSci/Machine Learning ...
This file must be titled “enrolments.csv”. Each row of the file defines a single user enrollment for a single course. The available columns for the enrolments.csv file are:
|action||Yes||Action to perform on the enrollment method, e.g. “enrol” or “unenrol”.|
|courseid||Yes||The external system identifier for the course to be enrolled in or unenrolled from.|
|userid||Yes||The external system identifier to the user to be enrolled or unenrolled.|
|roleid||Yes||The identifier of the role to be assigned the user, e.g. “student” or “teacher”.|
|timestart||No||The start date and time for the enrollment to take effect (in datetime format).|
|timeend||No||The end date and time for the enrollment to take effect (in datetime format).|
A sample enrolments.csv file might look something like this:
action,courseid,userid,roleid enrol,C554,STU3141,student unenrol,C802,STU3176,teacher ...
Once you have produced CSV files in the correct format, you’ll need to transfer them to Moonami’s server. You’ll need to transfer the files via the SFTP method, and in order to do this you will need credentials provided to you by Moonami.
You will be given a directory to transfer your users.csv, courses.csv, and enrolments.csv files to. It is recommended that you create a scheduled task (using cron or a similar scheduling program) that sends the exported files from your SIS to Moonami’s SFTP server at regular intervals.
Once you have transferred the files to Moonami’s server, the NexSIS plugin takes care of the rest. In order to see notifications or error messages that arise while NexSIS imports the data to the Moodle site, you can go to Site Administration > Reports > NexSIS logs. Please note that if you see an error that NexSIS has failed to import one of the files, NexSIS will simply retry importing the file next time it runs.