If you want to bulk upload courses to your site, you will need to create a CSV file.
Example file
The following example shows an upload file that sets the course short name, full name and category. There are no spaces between the items.
shortname,fullname,category
courserestored,Course restored,1
courserestored2,Course restored 2,1
courserestored3,Course restored 3,1
courserestored4,Course restored 4,1
The first row (shortname,fullname,category) sets out the column headings.
The first column in each subsequent row is the course short name. In this example, the course short names are courserestored, courserestored2, courserestored3 and courserestored4.
The second column is the course full name, which is displayed at the top of the course. In this example, the full names are Course restored, Course restored 2, Course restored 3 and Course restored 4.
The last column is the course category. This always uses the category ID rather than the category name. In this example, the category ID is 1, which is used for a category called Miscellaneous. The category name does not appear in the file, as only the category ID is used.
Categories must already exist before they can be used in a course upload. If the file contains a category ID that does not exist, the error Could not resolve category by ID is shown during the upload preview, and any courses in that category are not created.
Whatever other fields are included, the file requires the shortname and fullname fields, and one of the category, category_idnumber or category_path fields.
Course custom fields cannot be included in a course upload CSV file. Only the standard fields documented on this page are supported. Any custom field values must be set manually after the courses have been created.
Creating the text file
The course upload file must be a CSV file. The following columns can be used.
Course information fields
Most of these settings are also available in the course settings. Some settings are enabled or disabled using 1 (enabled) or 0 (disabled). This allows a setting to be enabled for some of the uploaded courses but not others. None of the fields controlled in this way are mandatory. To keep the default setting for all uploaded courses, leave the field out of the file.
Field names must be lowercase.
Field name | Description |
|---|---|
| The course full name. |
| The course short name. |
| The course ID number. |
| The ID of the category in the Totara database. This takes precedence over |
| The ID number of the category to add the course to. |
| The full path of the category to add the course to. For example, to add the course to a subcategory called Machine Learning within a top-level category called Engineering, set |
| If using traditional visibility, set to |
| If using audience-based visibility, set to |
| The date the course starts, for example dd/mm/yyyy. |
| The date the course ends, for example dd/mm/yyyy. |
| The course summary. |
| The course format. This must be a valid format that is enabled on the site. The standard format values are |
| The name of the theme the course is forced to use. |
| The default language for the course. |
| The number of news items to display in the news block, when used. |
| Set to |
| Set to |
| Set to |
| The maximum upload size, in bytes, for files within the course. Set to |
| The group mode for the course. Set to |
| Set to |
| Set to |
| Set to |
| The course type. Set to |
| A comma-separated list of tags to add to the course. |
Course action fields
These fields take precedence over the Course process parameters, which control what happens to the course, such as renaming, templates and resets.
Field name | Description |
|---|---|
| Set to |
| The new short name to give the course. The Allow renames setting must be enabled in the Import options settings. |
| An absolute path to a backup file to import into the course. |
| The short name of a course to import content from. |
| Set to |
The following course attributes are not restored when uploading courses from a CSV file:
Course image
Icon
Collapsible sections
Section header colours
Completion progress tracking on view
Summary format
Calendar type
Renaming courses
The course upload can be used to rename courses in bulk. Include the new short name for each course in the rename field. For example:
shortname,fullname,category,rename
original-shortname,System Course 1,1,updated-shortname
Role renaming
Roles can be renamed in the uploaded courses. Use the format role_[shortname] for the column heading, and enter the new role name in the course row. For example:
role_student,role_editingteacher,role_teacher
padawan,master,jedi
This renames the Learner role (role_student) to padawan, the Editing Trainer role (role_editingteacher) to master, and the Trainer role (role_teacher) to jedi.
Field name | Description |
|---|---|
| Renames a role in the course, where * is the short name of the role. |
Course format options
Field name | Description |
|---|---|
| The number of course sections. For the demo, topics and weeks formats only. |
| For the demo, topics and weeks formats only. |
| For the demo, topics and weeks formats only. |
| For the social format only. |
| The activity used by a course in the single activity format. Use only when |
Activity types for the single activity format
When format is set to singleactivity, the activitytype field sets which activity the course uses. This is the same as selecting an activity in the Type of activity setting when creating a single activity course manually.
The following values can be used. The activity must be installed and enabled on the site.
Activity | activitytype value |
|---|---|
Assignment |
|
Book |
|
Certificate |
|
Chat |
|
Choice |
|
Database |
|
External tool |
|
Feedback |
|
File |
|
Folder |
|
Forum |
|
Glossary |
|
IMS content package |
|
Lesson |
|
Page |
|
Quiz |
|
SCORM package |
|
Seminar |
|
Survey |
|
URL |
|
Wiki |
|
Workshop |
|
Additional activity types may be available if they have been installed and enabled on the site. For an additional activity type, use the plugin name without the mod_ prefix. For example, an activity plugin named mod_example uses the value example.
Labels cannot be used, as a label does not have its own page.
For example:
shortname,fullname,category,format,activitytype
quiz101,Compliance quiz,1,singleactivity,quiz
scorm101,Fire safety,1,singleactivity,scorm
seminar101,Induction seminar,1,singleactivity,facetoface
Note: If the activitytype value is missing or not valid, no error is shown. The course is created using the default activity type set for the single activity course format.
Note: The upload sets the activity type but does not create the activity itself. The activity is added the first time the course is opened by a user with permission to edit the course.
Enrolment options
Enrolment methods can be added and configured using enrolment fields. Name the field for each enrolment method enrolment_[number], and name each of its properties enrolment_[number]_[property].
Field name | Description |
|---|---|
| Sets enrolment options. The first wildcard (*) is a number identifying the enrolment instance, and the second is the name of the setting. The following settings can be used: |
For example:
enrolment_1,enrolment_1_role,enrolment_2,enrolment_2_startdate
manual,learner,self,20170629
In this example, enrolment_1 is set to the manual enrolment method, with a default role of learner. enrolment_2 is set to the self-enrolment method, with an enrolment start date of 29 June 2017 (20170629).
These fields come after the mandatory shortname, fullname and category fields. A full example is:
shortname,fullname,category,enrolment_1,enrolment_1_role,enrolment_2,enrolment_2_startdate
courserestored,Course restored,1,manual,learner,self,20170629
courserestored2,Course restored 2,1,manual,learner,manual,20170530
courserestored3,Course restored 3,1,self,editingtrainer,self,20181212
courserestored4,Course restored 4,1,self,learner,manual,20180107
Upload courses is not yet compatible with all enrolment methods.
Notes about behaviour
When a backup file is provided, the course upload tool uses the restore functionality and does not turn on the Overwrite course configuration option. For this reason, settings such as completionprogressonview and numsections are not carried from the backup to the course. The tool does not force Overwrite course configuration, because some of the settings already come from the uploaded CSV file. Course settings are not taken from the backup unless the Overwrite course configuration option is selected.
When a backup is provided as a template for uploaded courses, the course settings are not taken from it. They must be provided in the CSV file, using the supported fields.
When a course backup file is restored as a new course, it restores as expected. However, when Restore into this course is selected from an existing course, the default restore settings are used. When the restore is complete, the existing course keeps its own settings (for example completionprogressonview) rather than taking those from the backup.
Join the Totara Community for more resources to help you get the most out of Totara.
© Copyright 2025 Totara Learning Solutions. All rights reserved. Some content originally obtained via GPLv3 license and continues to be available under GPLv3. All other content is the sole copyright of Totara Learning Solutions.