Loading...

How to Backup and Restore a Moodle Course

A course can be backed-up with some or all of its parts by using the course backup.

IMPORTANT NOTE:

The requirement for a Course Backup should be solely if you are creating a master course that you would like to then copy across multiple courses. Only the master copy should be backed up.

As part of your Moodle hosting policies, every night we conduct automated backup of your entire Moodle site. Learn More? Moodle Site Backup

Therefore, before you proceed any further about backing up a Moodle course you need to consider the following:

  • this is a duplication of what Wisenet is already doing for you
  • if you use more than your allocated server space, there will be a cost for exceeding that quota
  • if you require a copy of a course with an older date, simply log a support request as per the Site Backup Process
NOTE:

When setting up a Course Backup you can include almost all the data in the course. However, you should be aware of the fact that some things are not backed up:

  • Quiz questions are only backed up if at least one question from their category has been added to a quiz.
  • Scales are only backed up if they are used by at least one activity.
  • Users’ passwords are not backed up even when the “Include enrolled users” option is selected.
  • Glossary data.
  • Badges are not backed up if they have not been awarded to at least one user and users are not included in the course backup.
Before you begin
  • Do you need to copy an entire Course? If yes, go to Step 1 below on how to manually back up a Course.

OR

1

Backing up a Course Manually
  1. Go to Administration > Course administration > Backup
  2. 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, anonymise user information, or include user role assignments, groups, groupings, user files, comments, user completion details, course logs and grade history in the backup.
  3. Schema settings – Select/deselect specific items to include in backup, then click the Next button.
  4. If desired, select specific types of activity to be backed up by clicking the link ‘Show type options’
  5. Confirmation and review – Check that everything is as required, using the Previous button if necessary, otherwise click the Perform backup button
  6. Complete – Click the Continue button

2

Setting an Automated Course Backup Schedule
  1. Go to Administration > Site administration > Courses > Backups > Automated backup setup
  2. Set backup_auto_active to enabled
  3. Select the days of the week to run the backup
  4. Set the execution time for the backup process. For most servers, early morning will be the best time. Keep in mind the time zone your server is using.
  5. Set the “Save to…” path. If you can, choose a backup path on another machine or on a different drive than the one Moodle is on. You don’t want to lose your backups at the same time you lose your Moodle site if the drive fails. If you leave the field blank, then backup zip files will be saved in the backup folder of each course files folder. On a Linux server the path might look like: /home/(your user or domain)/public_html/archive/ or if it’s below the publicly accessible folders: /home/(your user or domain)/archive/ if the path is not recognized a red X is shown after saving, otherwise a green check.
  6. Set all other options appropriately.
  7. Click the Save changes button.

Note

Wisenet allows to configure automatic backups using the following settings:

  • Schedule: Sunday
  • Execute at: 1:10am AEST
  • Keep: 2

Please contact Wisenet if you require different backup settings.  You can see when the most recent backup file was created under Course Administration > Restore

Note

  • To save disk space, you can choose to delete backups older than a specified number of days. If so, you should also specify a minimum number of backups to be kept. (The settings ‘Delete backups older than’ and ‘Minimum number of backups kept’ are new in Moodle 3.0 onwards.)
  • Once you’ve set up your backup schedule, Moodle will automatically create archives of all the courses on the server at the time you specified. Once the backup is complete, Moodle will send you an email describing the status of the backup.

Warning

  • If you decide to save your auto course backup on your current Moodle server and you use more than your allocated server space, there will be a cost from Wisenet for exceeding that quota

3

Restoring a Course Backup

Note

During the restore process, you will be given the option to restore as a new course or into an existing course.

  1. Go to Administration > Front page settings > Restore (if you have front page permissions) or Administration > Course administration > Restore (if you have an empty course to restore into.)
  2. Upload the backup file or choose a file in the course backup area or user private backup area and click Restore
  3. Confirm – Check that everything is as required then click the Continue button
  4. Destination – Choose whether the course should be restored as a new course or into an existing course then click the Continue button
  5. Settings – Select activities, blocks, filters and possibly other items as required then click the Next button
  6. Schema – Select/deselect specific items and amend the course name, short name and start date if necessary then click the Next button
  7. Review – Check that everything is as required, using the Previous button if necessary, then click the ‘Perform restore’ button
  8. Complete – Click the continue button

Warning

  • If you are restoring a course with user data (forum posts for example) then be careful when setting the course start date as all data will display within the same timeframe but from the new start date
  • If your new course has fewer sections than the course you are restoring, the extra sections will appear as “orphaned activities”. Increase the number of sections in the new course to make them visible.
  • If you are restoring a course from a different Moodle site and you obtain the error message “Trying to restore user (admin) from backup file will cause conflict”, you can enable the setting ‘Allow admin conflict resolution’ in Site admin > Courses > Backups > General import defaults