MoodleScript: RESTORE COURSE

MoodleScript Script Engine

Effect

Restores a course from an available archive.

Syntax

  RESTORE COURSE <courseidentifier> IN <categoryidentifier> FROM <source> HAVING
  shortname: <shortname>
  fullname: <fullname>
  summary: <summary>
  idnumber: <idnumber>
  visible: <visible>
  order: last

Minimal instruction:

  RESTORE COURSE FROM FILE <filepath> IN <categoryidentifier> HAVING
  shortname: <shortname>
  fullname: <fullname>

Examples

  RESTORE COURSE idnumber:Gabarit IN idnumber:CAT_NOUVEAUX_COURS FROM backup HAVING
  summary: A new course to restore from an existing archive
  idnumber: COPIEDECOURS
  shortname: COPIEDECOURS
  fullname: :coursefullname
  visible: 1
  RESTORE COURSE FROM FILE /var/archives/moodle/gabarit_de_cours.mbz IN id:32 HAVING
  shortname: COPIEDECOURS
  fullname: :coursefullname

Minimal invocation

Specific attributes

Default values

Impact on the execution stack context

At the end of the restore, sets the current course identifier (courseid) to the restored course and the current category identifier to the target category (coursecatid).

Back to the language index - Back to the component index