A course can be saved with some or all of its parts by using the course backup. Typically, the site administrator will set a schedule of automated course backups for the whole site. A teacher with editing privileges can create a backup or download an existing backup for safe keeping, or for use on another Moodle site.
Backing up a course
- Go to Settings > Course administration > Backup
- Initial settings - Select activities, blocks, filters and other items as required then click the Next button. Users with appropriate permissions, such as administrators and managers, can choose whether to include users, anonymize user information, or include user role assignments, user files, comments, user completion details, course logs and grade history in the backup.
- Schema settings - Select/deselect specific items to include in backup then click the Next button
- Confirmation and review - Check that everything is as required, using the Previous button if necessary, otherwise click the 'Perform backup' button
- Complete - Click the Continue button
A backup file (with distinctive .mbz extension to avoid confusion with .zip files) is then saved in the course backup area.
Anonymizing user information
Anonymize user information is a backup feature which "protects user identities" by making each user anonymous. If this box is checked in the backup initial settings, Moodle will substitute aliases for real names, substituting @example.com e-mail addresses and so forth. For example "Max Manager" might become "anonfirstname4 anonlastname4".
Restoring a course backup
A course backup file (.mbz) may be restored from within any existing course for which you have permission. During the restore process, you will be given the option to restore as a new course or into an existing course.
- Go to Settings > Front page settings > Restore or Settings > Course administration > Restore
- Upload the backup file or choose a file in the course backup area or user private backup area and click Restore
- Confirm - Check that everything is as required then click the Continue button
- Destination - Choose whether the course should be restored as a new course or into an existing course then click the Continue button
- Settings - Select activities, blocks, filters and possibly other items as required then click the Next button
- Schema - Select/deselect specific items and amend the course name, short name and start date if necessary then click the Next button
- Review - Check that everything is as required, using the Previous button if necessary, then click the 'Perform restore' button
- Complete - Click the continue button
Backup and restore for Moodle2+
Courses created in 1.9 can be backed up and then restored into a 2.1 Moodle or later but blocks are not currently restored and nor is user data (such as forum posts, grades, submissions etc).
Backup and restore of assignments from Moodle 2.2 and older
The assignment activity module was completely rewritten in Moodle 2.3. Thus, assignments from Moodle 2.2 and older (e.g. from Moodle 1.9) need to be upgraded in order to continue being usable.
Tips and tricks
- Lose content after a restore in Moodle 2.0 ? Do you see topic headings that say "Orphaned activities"? Solution: Go to course settings and increase the number of topic sections and things will return to normal.
The backup and restore processes can offer the teacher and administrators many creative solutions.
- Duplicating courses or specific activities in one course to another course (similar to Import)
- Updating a production Moodle site course, with material from a localhost site course
- Transferring a course to a new Moodle site.
- In earlier versions of Moodle, a way of rolling a course forward without past student activity
- Creating a blank activity, save just that activity and then restore it to the course or another course one or more times.
General backup defaults
Default settings for course backups can be set by a site administrator in Settings > Site administration > Courses > Backups > General backup defaults.
Selected settings may be locked, so that they cannot be changed when creating a course backup.
By selecting a time in the "Keep logs for.." dropdown, it is possible to specify how long backup logs information is kept before being deleted. As this information may be very large, it is recommended the length of time chosen be quite short.