Note: You are currently viewing documentation for Moodle 3.11. Up-to-date documentation for the latest stable version of Moodle may be available here: Download courses.

Download courses: Difference between revisions

From MoodleDocs
Download courses
Type Enter the plugin type e.g. activity, block, filter
Set N/A
Downloads Enter the plugins directory link
Issues Enter the bug tracker URL
Discussion Enter the link to the forum or discussion thread
Maintainer(s) Alexandru Elisei
mNo edit summary
(info box - please fill in)
Line 1: Line 1:
{{Infobox plugin
|type = Enter the plugin type e.g. activity, block, filter
|entry = Enter the plugins directory link
|tracker = Enter the bug tracker URL
|discussion = Enter the link to the forum or discussion thread
|maintainer = [[User:Alexandru Elisei|Alexandru Elisei]]
|float = Enter left or right to make the box float to that side (optional)
}}
[[Category: Course]]
[[Category: Course]]
==Download courses==
==Download courses==

Revision as of 06:18, 9 December 2015

Download courses

Allows an administrator to download a list of all the courses to a comma-separated values format (CSV) or Excel 2007 file format. In addition to the web interface there is also a command line tool located in admin/tool/downloaddata/cli/downloaddata.php.

To download courses:

  1. Proceed to Administration > Site administration > Courses > Download courses
  2. Select the download options, then click on the download button
Download courses page

Instalation

This plugin has been tested to work with Moodle 2.7 and newer. There are no guarantess it will work with earlier versions.

General installation procedures are those common for all Moodle plugins: Installing plugins.

First, you need to choose the branch corresponding to your Moodle version. Then you can choose between cloning the repository, downloading the zip file and extracting it or using the zip file for the plugin install interface accessible at Administration > Site administration > Plugins > Install plugins.

If you choose to clone the repository, then you need to clone it into MOODLE_ROOT_DIRECTORY/admin/tool/downloaddata by specifying the branch. For example, if you have Moodle 3.0 installed:

   git clone -b MOODLE_30_STABLE https://github.com/alexandru-elisei/moodle-tool_downloaddata.git MOODLE_ROOT_DIRECTORY/admin/tool/downloaddata

replacing MOODLE_ROOT_DIRECTORY with the actual Moodle installation root directory path. The zip file should be extracted to the same location.

Keep in mind that cloning the repository also creates a hidden .git directory.

Note: If you decide to use the install plugin interface don't forget to rename the folder inside the archive to downloaddata.

Download options

There are several options to choose from when download the courses:

File format
Choose the file format: CSV or Excel 2007.
Encoding
Choose an encoding for the file. Only available when downloading a CSV file.
CSV delimiter
Choose a delimiter for the CSV file fields.
Use defaults
Whether to use the default fields and overrides (if the option is selected) provided in admin/tool/downloaddata/config.php.
Override fields
Whether to override fields or not. You can either use the overrides provided in admin/tool/downloaddata/config.php by selecting Use defaults or provide you own overrides as a comma separated list of field=value pairs. Note: by default there are no overrides specified in the admin/tool/downloaddata/config.php file.
Sort by category path
Whether the courses should be sorted by the category path. Useful if the site uses a Year/Semester or similar hierarchy for course categories.

Downloading the file

In order to successfully download the file you need to specify which course fields should be saved. This can be done by either choosing Use defaults and providing the fields in the admin/tool/downloaddata/config.php file or manually specifying them in the Fields section of the page.

Likewise, if you have chosen to use overrides, then you similarly need to provide them in the admin/tool/downloaddata/config.php file or in the Overrides section of the page.

Course fields

You can specify which fields to be present in the downloaded file in the Fields section as a comma separated list of valid field names. Valid fields are those described Upload courses under the section Course information fields. The fields specified here will take precedence over the default fields from admin/tool/downloaddata/config.php even if the Use defaults option was selected.

Course overrides

If you have enabled Use overrides you can specify the overrides as a comma separated list of field=override pairs in the Overrides section. There are no restrictions on the field names or values. Any data specified here will take precedence over the overrides from admin/tool/downloaddata/config.php file. Note: any values specified here have no effect if the Use overrides option isn't selected.