Note: This documentation is for Moodle 2.7. For up-to-date documentation see Course backup.

Course backup: Difference between revisions

From MoodleDocs
(→‎See also: Front page link)
(copied from 2.8 docs)
 
(59 intermediate revisions by 13 users not shown)
Line 1: Line 1:
{{Course admin}}
{{Backup}}
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 backup|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. 


Generally, you will not have to worry about '''course backups''', as the primary Moodle administrator will have set a schedule of site wide backups. However, as a teacher with editing privileges, it is good practice to download a recent backup to your own computer for additional protection.
==Backing up a course==


==Backups Moodle 1.6 onward==
To backup a course
{{Moodle 1.6}}
Moodle 1.6 supports granularized backup, in addition to the previous versions features.  For example, individual activities may be selected for backup, with an option to include student data for each activity. See [[Backup_restore|"backup restore" for 1.6]], for a more detailed description of these features.


==Older versions==
* Go to ''Administration > 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 [[Backup of user data|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.


Generally, you will not have to worry about '''course backups''', as the primary Moodle administrator will have set a schedule of site wide backups. However, it is good practice to perform a course backup at regular intervals, and to store this backup locally on your computer.
* If desired, select specific types of activity to be backed up by clicking the link 'Show type options'  


After clicking the Backup link you will see options for specific activities you wish to backup. If you want to back up all the course activities you should choose 'All' above the activities listed. Similarly, if you want to include User Data with each backed-up activity, choose 'All' on the right-hand side of the field.
{|
|[[File:26backuprestore1.png|thumb|Back up screen with option to select all or none]]
|
|[[File:26backuprestore2.png|thumb|Back up screen with option to select activity types]]
|}


Below the list of activities you will find five other fields to define:
* 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


* Metacourse - If you are backing up the content of a [[Metacourses|metacourse]], you may enable this option so that that relations between the courses will be exported and the restore process will try to rebuild them in the destination server.
A backup file (with distinctive .mbz extension to avoid confusion with .zip files) is then saved in the course backup area. Backup file names are of the form ''backup-moodle2-course-coursename-date-hour.mbz'', ending in ''-nu.mbz'' when backed up with no users and ''-an.mbz''  with anonymized names.
* Users - Whether you want to backup the content concerning all the registered students in your site, only course students or no students at all.  
* Logs
* User files - If you enable this option, it will export, for now, user photos (as they are all the files related to one user currently).  
* Course files


After choosing what you want to backup, click on Continue. You will receive a notice with the backup details showing the total number of items within each category/module to be backed up. Scrolling to the bottom and clicking Continue, you will back up your course materials. You should see, again, the backup details followed by a message "Backup completed successfully." Clicking on Continue, you will receive a list of all the backup files in your course.
==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 @doesntexist.com email addresses and so forth. For example  "Max Manager" might become  "anonfirstname4 anonlastname4".
 
==Backup and restore from 1.9 to 2==
 
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. See the section 'Restoring course backups from Moodle 2.2 and older' in [[Assignment upgrade tool]] for details of what to do.
 
==Backing up courses larger than 4GB==
Site administrators can enable a compression format for .mbz files (internally stored as a .tar.gz file) from ''Site administration>Development>Experimental>Experimental settings'' which removes the 4GB backup size restriction and may improve performance. If this box is checked, then future courses will be backed up in this format. It won't affect restoring courses.
 
==CLI backup script==
See MDL-39617 for how to back up a huge course via the command line.
 
==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.


==Creative uses==
==Creative uses==
The backup and restore processes can offer the teacher and administrators many creative solutions.
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
*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
*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
*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.
==Course backup capabilities==
*[[Capabilities/moodle/backup:anonymise|Anonymise user data on backup]]
*[[Capabilities/moodle/backup:backupcourse|Backup courses]]
*[[Capabilities/moodle/backup:backupsection|Backup sections]]
*[[Capabilities/moodle/backup:backuptargethub|Backup for hub]]
*[[Capabilities/moodle/backup:backuptargetimport|Backup for import]]
*[[Capabilities/moodle/backup:configure|Configure backup options]]
*[[Capabilities/moodle/backup:downloadfile|Download files from backup areas]]
*[[Capabilities/moodle/backup:userinfo|Backup user data]]


==See also==
==See also==
*[[Backup restore]]
*Forum post [https://moodle.org/mod/forum/discuss.php?d=310227#p1241735 Back up via command line]
*[[Restore]]
*[[Course restore]]
*[[Backup FAQ]]
*[[Backup of user data]]
*[[Roll courses forward]]
*[[Activity backup]]
*[[Front page]] trick to backup Front page in earlier version of Moodle
* [http://youtu.be/rg6rUuBwITo Moodle 2 Administration Courses] MoodleBites video on YouTube
*[http://www.youtube.com/watch?v=ZrdM_KOr530 Creating course backups video]
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=59581 Location of Backup Files] forum discussion
 
[[Category:Backup]]


[[de:Kurssicherung]]
[[es:Respaldo del curso]]
[[eu:Ikastaroaren_Segurtasun-kopia]]
[[fr:Sauvegarde de cours]]
[[fr:Sauvegarde de cours]]
[[es:backup/backup]]
[[ca:backup/backup]]
[[ja:コースバックアップ]]
[[ja:コースバックアップ]]

Latest revision as of 10:40, 25 March 2015

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

To backup a course

  • Go to Administration > 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.
  • If desired, select specific types of activity to be backed up by clicking the link 'Show type options'
Back up screen with option to select all or none
Back up screen with option to select activity types
  • 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. Backup file names are of the form backup-moodle2-course-coursename-date-hour.mbz, ending in -nu.mbz when backed up with no users and -an.mbz with anonymized names.

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 @doesntexist.com email addresses and so forth. For example "Max Manager" might become "anonfirstname4 anonlastname4".

Backup and restore from 1.9 to 2

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. See the section 'Restoring course backups from Moodle 2.2 and older' in Assignment upgrade tool for details of what to do.

Backing up courses larger than 4GB

Site administrators can enable a compression format for .mbz files (internally stored as a .tar.gz file) from Site administration>Development>Experimental>Experimental settings which removes the 4GB backup size restriction and may improve performance. If this box is checked, then future courses will be backed up in this format. It won't affect restoring courses.

CLI backup script

See MDL-39617 for how to back up a huge course via the command line.

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.

Creative uses

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.

Course backup capabilities

See also