Loading...

How to Backup and Restore a Moodle Course

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.  Automated course backups runs the same functions as individual course backups. It’s a good idea to schedule backups for when your server isn’t usually busy. Running the backup tool over all the courses can be processor-intensive, so you shouldn’t run it when there are a lot of students trying to access the server. You should always alert users with an announcement on the first page that if they log on during the backup hours they may notice a decrease in performance.

Before you begin:

Required Knowledge: Moodle

Required Moodle Access: Admin

1

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.

2

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

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

Was this Resource helpful?