Difference between revisions of "Course backup"

Jump to: navigation, search
m (Changed bannerlink to talk:)
(updated video for 3.6)
(44 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Re-using courses and activities}}
+
{{Backup}}
<p class="note">'''Please refer to [[Talk:Course backup|these notes]] before editing this page.'''</p>
+
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 can create a backup or download an existing backup for safe keeping, or for use on another Moodle site.
<p class="note">'''Note:''' Backup and restore has been completely rewritten for Moodle 2.0. See [[Backup 2.0]] for details.</p>
 
  
 +
{{MediaPlayer | url = https://youtu.be/wGxj6Pl6VBQ| desc = Course backup: Moodle 3.6}}
  
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. 
 
  
 +
==Backing up a course==
  
==Creating a course backup==
+
To backup a course
[[Image:Course_backup.jpg|thumb|Creating a course backup - page 1]][[Image:Course_backup_s2.jpg|thumb|Creating a course backup - page 2]][[Image:Course_backup_s3.jpg|thumb|Creating a course backup - page 3]]
 
To create a course backup:
 
#Click Backup in the [[Course administration block]].
 
#Select your backup options (Page 1)
 
##Choose the activities and resources you want to include, the default is everything. 
 
##*The Include All/None links at the top will check or uncheck all the boxes in a column.
 
##*Use the individual boxes to select or unselect specific parts of the course for the backup.
 
##Select course options desired at the bottom (see Backup options below)
 
#Click the Continue button to start the backup process.
 
#On the next page (Page 2)
 
#*You can edit the default backup filename at the top of this page (uses format:backckup-COURSESHORTNAME-DATE-TIME.zip).
 
#*You will see the backup details, a list of files and user data that Moodle will include in the backup
 
#Click the Continue button at the bottom. Or if this does not look right, use cancel to exit the backup process or use your back browser arrow to return to the initial course backup page.
 
#On the next page (Page 3), the progress of the backup is displayed.
 
#*You should see the message "Backup completed successfully" at the bottom of the page.
 
#Click the Continue button.
 
#You will then be taken to the backupdata directory (see page 4).[[Image:Backupdirectory.png|200px|thumb|backupdata directory - page 4]]
 
#*You may click on a filename to download any backup file to your computer.
 
#*Later this area can be reached by the Course administration block by using the Restore link or looking for what is usually called the backupdata folder under the Files link.
 
  
==Backup options==
+
# Go into the course.
 +
# Click the Backup link either in the gear menu or the Administration block (depending upon the theme).
 +
# 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, groups, groupings, 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'
 +
# 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 relations between the courses will be exported and the restore process will try to rebuild them in the destination server.
+
{|
* Course files - This backs up any file stored in the [[Files|files]] area for the course
+
[[File:backupgroups.png|thumb|Backup settings]]
* Backup role assignments for these roles - This setting provides a way of copying a custom role from one Moodle site to another. See 'How do I copy a custom role from one Moodle site to another' in [[Roles FAQ]] for details.
+
|
 +
|[[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]]
 +
|}
  
==Backup of user data==
+
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 with the capability [[Capabilities/moodle/backup:userinfo|moodle/backup:userinfo]] (by default only admins) have the following additional backup options:
+
Tip: If you are satisfied with the default settings and don't wish to go through all the backup screens, you can simply click 'Jump to final step' to perform the backup.
  
* User data - This backs up all student files, submissions, forum postings, glossary entries, etc.
+
==Anonymizing user information==
* Users - Whether you want to backup the content concerning course students or no students at all. By selecting "none", the backup process will not backup user data. Users with the capability [[Capabilities/moodle/site:backup|moodle/site:backup]] in the system context have the additional option to backup all users on the site.
 
* Logs - This backs up all [[Reports|course activity logs]]
 
* User files - This backs up all user pictures
 
  
''Note'': In Moodle 1.8.11 and 1.9.7 onwards, hashed user passwords are no longer saved in backup files containing user data. If a backup is restored to a new site, users will be asked to go through the "forgot my password" routine the first time they log in.
+
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 via CLI for administrators==
 +
 
 +
Site administrators can backup selected courses using a CLI script.
 +
 
 +
===Options===
 +
* --courseid=INTEGER (Course ID for backup.)
 +
* --courseshortname=STRING (Course shortname for backup.)
 +
* --destination=STRING (Path where to store backup file. If not set the backup will be stored within the course backup file area.)
 +
* -h, --help (Print out this help.)
 +
 
 +
===Example===
 +
\$sudo -u www-data /usr/bin/php admin/cli/backup.php --courseid=2 --destination=/moodle/backup/
 +
 
 +
==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==
Line 52: Line 56:
 
*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.  
 
*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 'General backup defaults' in the Site administration.
 +
 +
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 stops above 90%, not showing any errors==
 +
This has been reported to be caused by:
 +
* a [[Course_formats#Contributed_Course_Formats|non-standard course_format]]. Try replacing the course format.
 +
* not enough server RAM. Adding more RAM to your server is usually the first [[Performance_recommendations|performance recomendation]].
 +
 +
==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==
  
 
*[[Course restore]]
 
*[[Course restore]]
*[[Automated course backup]] - for administrators
+
*[[Backup of user data]]
*[[Backup and restore FAQ]]
+
*[[Activity backup]]
*[[Roll courses forward]]
+
* Administrators can use [http://moosh-online.com/commands/#course-restore MOOSH] to bulk backup and restore courses from CLI
*[[Front Page]] trick to backup Front page in earlier version of Moodle
 
*[http://www.youtube.com/watch?v=ZrdM_KOr530 Creating course backups video]
 
* [http://knol.google.com/k/art-lader/moodle-avert-a-disaster/10r7i4g9er58l/1# Google Knol article]
 
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=59581 Location of Backup Files] forum discussion
 
 
 
[[Category:Backup]]
 
  
[[ca:backup/backup]]
 
 
[[de:Kurssicherung]]
 
[[de:Kurssicherung]]
[[es:Copia de Seguridad del Curso]]
+
[[es:Respaldo del curso]]
 
[[eu:Ikastaroaren_Segurtasun-kopia]]
 
[[eu:Ikastaroaren_Segurtasun-kopia]]
 
[[fr:Sauvegarde de cours]]
 
[[fr:Sauvegarde de cours]]
 
[[ja:コースバックアップ]]
 
[[ja:コースバックアップ]]

Revision as of 12:34, 16 January 2019

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 can create a backup or download an existing backup for safe keeping, or for use on another Moodle site.

Course backup: Moodle 3.6


Backing up a course

To backup a course

  1. Go into the course.
  2. Click the Backup link either in the gear menu or the Administration block (depending upon the theme).
  3. 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, groups, groupings, user files, comments, user completion details, course logs and grade history in the backup.
  4. Schema settings - Select/deselect specific items to include in backup, then click the Next button.
  5. If desired, select specific types of activity to be backed up by clicking the link 'Show type options'
  6. Confirmation and review - Check that everything is as required, using the Previous button if necessary, otherwise click the 'Perform backup' button
  7. Complete - Click the Continue button
Backup settings
Back up screen with option to select all or none
Back up screen with option to select activity types

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.

Tip: If you are satisfied with the default settings and don't wish to go through all the backup screens, you can simply click 'Jump to final step' to perform the backup.

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 via CLI for administrators

Site administrators can backup selected courses using a CLI script.

Options

  • --courseid=INTEGER (Course ID for backup.)
  • --courseshortname=STRING (Course shortname for backup.)
  • --destination=STRING (Path where to store backup file. If not set the backup will be stored within the course backup file area.)
  • -h, --help (Print out this help.)

Example

\$sudo -u www-data /usr/bin/php admin/cli/backup.php --courseid=2 --destination=/moodle/backup/

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 'General backup defaults' in the Site administration.

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 stops above 90%, not showing any errors

This has been reported to be caused by:

Course backup capabilities

See also