Skip to main content

backup/restore a Moodle course

Only people with administrator rights can use backup/restore functions on CCLE/Moodle. One can use the backup/restore functions in the Administration block to copy the course content 1) from the archive server (Moodle 1.8) to the production server (Moodle 1.9), or 2) from one course to another on the same server. Please note that the import function serves a similar but limited purpose. Click here to view the KB article on using Import.

  • Restore/backup of a large site may interrupt the server; therefore, it is recommended to backup/restore only sites smaller than 100MB during the peak hours (9am-9pm).
  • Please remember to delete the backup files on both the source and target sites after the backup/restore process is complete.

Scenario #1: The target course has an SRS number and automatically pulls participant data from the Registrar (e.g., a regular UCLA course).

Most times we don’t need to migrate the user data/files, and the target course already exists. We thus will follow the steps below.

A. At the source course website

  1. Check for any abnormal course setting or huge file size. Make a note to yourself when necessary.
  2. Click “Backup”. Make sure you choose “None” for “User Data”, “No” for “Metacourse”, “None” for “Users”, and “No” for “User Files”.
  3. Click “Continue” all the way till you’re taken to the “Files” area.
  4. Click the backup file and save it to your local hard drive.

B. At your local hard drive

  1. Check if the backup file is larger than 1GB. If yes, unzip the file and move out large files to cut the total size well below 1GB , and then re-zip the folder.

C. At the target course website

  1. Click “Restore” in the Administration block, and upload the zip file.
  2. Perform the “Restore” action.
  3. Click “Yes”, and then “Continue”.
  4. For the “Restore to” field, choose “Existing course, adding data to it”.
  5. Choose “None” for “User Data”, “No” for “Metacourse”, “None” for users, “None” for “Groups and groupings”, and “No” for “User Files”.
  6. Browse the “Role mappings” to check if the source and target roles are consistent.
  7. Click “Continue”, and you’ll be prompted to choose the target course. Click on the course title, and then “Restore the course now”. The restoring process may take a couple of minutes.
  8. When the process is complete, click “Continue” at the page bottom. You’ll then be taken to the course front page.
  9. If you have moved out any file from the original backup folder at Step 5, go to the Files area and upload it.
  10. Check that all resources are set to the Private Course Materials grouping.
  11. Check the site for internal links that are broken (ie. Images inside webpages, wikis, books, etc. or links to other areas within your course). Front page links to resources and activities should be fine (unless you have altered the course shortname).

Scenario #2: The target course has no SRS number (e.g., a collaborative or test site).

We often want to keep the user data/files and create a new course on the prod server. To do the backup/restore, we go through Steps A1-C11 as in Scenario #1, with the following exceptions:

  • Find a shell course on the prod server to perform the “restore” function.
  • At Steps A2 & C5, leave everything as the system default but “Metacourse” (set to “No”) and “Groups and groupings” (set to “No”).
  • At Step C4, choose “New course” for the “Restore to” field and specify the category of the new course.