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 slow down the server; therefore, it is recommended to backup/restore only sites smaller than 100MB during the peak hours (9am-9pm).
  • Inspect the Administration→Files on the source course before you start the backup. If there are any unusually large files, you may want to move them to your local drive first and then upload them to the target site later manually after the restore process.
  • Please remember to delete the backup files (.zip) on both the source and destination sites after the backup/restore process is complete because those files are no longer needed and may take up considerable space.

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 of the following: “None” for “User Data”, “No” for “Metacourse” (if present), “None” for “Users”, and “No” for “User Files”. Don’t change those settings unless necessary.
  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. Under title “Action” click “Restore” on the zip file (If you click “List” instead, you’ll see the content of the zip file).
  3. Click “Yes” for “Do you want to continue?” It’ll take a while.
  4. Click “Continue”.
  5. For the “Restore to” field, choose “Existing course, adding data to it”.
  6. Make sure “None” for “User Data”, “No” for “Metacourse”, “None” for “Users”, “Groups and groupings” for “Groups and groupings” (otherwise you’d get a public/private error in the later phase), and “No” for “User Files”.
  7. Browse the “Role mappings” to check if the source and target roles are consistent. For example, if the source role is administrator, the target role should be the same.
  8. Click “Continue”. Choose the right target course, and then click “Restore the course now”. The restoring process may take a couple of minutes.
  9. When the process is complete, click “Continue” at the page bottom. You’ll then be taken to the course front page.
  10. If you have moved out any file from the original backup folder at B1, go to the Files area and upload it.
  11. Check that all resources are set to the Private Course Materials grouping (There should a lock icon next to each item).
  12. 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 (e.g. your test site) on the prod server to perform the “restore” function.
  • At Steps A2 & C5 choose the right settings to suit your specific needs.
  • At Step C4, choose “New course” for the “Restore to” field and specify the category of the new course.