Skip to main content

backup/restore a Moodle course

Only people with administrator or instructor rights can use backup/restoreBackup/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 importImport function serves a similar but limited purpose. Click here to view the KB article on using Import.

  • Restore/backupBackup of a large site may slow down the server; therefore,therefore it is recommended to backup/restoreBackup/Restore only sites smaller than 100MB during the peak hours (9am-9pm).
  • InspectLook at Files under the Administration→FilesAdministration block 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/restoreBackup/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. AtIn the source course websitewebsite:

  1. CheckGo to Settings (under the Administration block) and check for any abnormalspecial course settingsettings or(such hugeas filean size.Enrollment MakeKey) and make a note of these. They will need to yourselfbe whenadded necessary.to the new course once it has been restored. You may wish to print the Settings page for reference.
  2. Click “Backup” (under the Administration block). By default all Resources and Activities are included, but no User Data is included. Uncheck any materials you do not want to back up. Normally User Data (which includes student files, submissions, forum postings, glossary entries, etc.) does not need to be brought in, but you may select User Data if desired.
  3. Make sure of the following:following “None”settings:
    for “User Data”, “No” for “Metacourse” (if present): “No”,
    • “Users”: “None” for “Users”, and
    “No” for “User Files”: “No”.
  4. Don’t
  5. At changethe thosebottom settingsof unless“Backup necessary.role assignments for these roles”, select “None”.
  6. Click “Continue”. The next two screens will show a summary of your backup. Verify that all the wayinformation tillis you’recorrect takenand click “Continue” until you arrive at the Files > backupdata area.
  7. If you want to see a summary of your backup data, click “List” (under the “Files”Action” area.column).
  8. Click the backup file and saveSave it to a location on your computer where you will be able to find it.

B. On your local hard drive.

B. At your local hard drivedrive:

  1. Check if the backup file is larger than 1GB. If yes,it is, unzip the file andfile, move outthe large files to cutanother folder to reduce the total size well below 1GB ,1GB, and then re-zip the folder. You will upload these files separately at a later point.

C. AtIn the target course websitewebsite:

  1. Click “Restore” in the Administration block,block.
  2. Click “Upload a file”, “Browse” to where you saved the backup file, and uploadselect theit. zipClick file.“Upload this file”.
  3. Under titlethe “Action” column, click “Restore”. (Do not click on the zip file (Ifname itself. This will prompt you clickto “List” instead, you’ll seedownload the content of the zip file).file.)
  4. Click “Yes” for “Do you want to continue?” It’llThis may take asome while.time.
  5. ClickA summary of the Course restore will appear. Review one last time to make sure everything is correct, then click “Continue”.
  6. For Important: In the “Restore to” field, choose “Existing course, adding data to it”. (The default will restore into a brand-new course site.)
  7. Make sure “None”of forthe following settings (some of these settings will not be able to be changed, depending on the settings chosen during the backup process):
    “User Data”: “None”,
    • “Metacourse”: “No”,
    forMetacourse”,Users”: “None”,
    for “Users”, “Groups and groupings” for: “Groups and groupings” (otherwise you’dyou may get a public/private mismatch error in the later phase),
    and “No” for “User Files”: “No”.
  8. BrowseCheck the “Role mappings” to checkbe ifsure that the source and target roles are consistent. For example, if the source role is administrator,Instructor, the target role should be the same.
  9. Click “Continue”. ChooseScroll to the right target course,course and thenselect it. On the next screen click “Restore the course now”. The restoring process may take a couple offew minutes.
  10. When the process is complete, click “Continue” at the page bottom. You’llYou will then be taken to the course front page.
  11. If you have moved out any file from the original backup folder at B1, go to the Files area and upload it.
  12. CheckVerify that all resources you want to be private are set to theas Private Course Materials groupingMaterials. (ThereTo shouldchange athe public/private setting on an item, turn editing on and click on the lock icon next to each item).item.)
  13. Check the site for internal links that are broken (ie.e.g. Imagesimages 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#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.