Restoring a Moodle Collaboration Site from Archive to Production

If you are trying to restore a collaboration site from the Archive server unto the Production server but are getting user data errors (and the restore is failing), check to make sure that all users who appear in the pink error box have the exact same user information in their profiles on both the Archive and Production servers. (You can open two windows and do a side-by-side comparison.)

For example, make sure all email addresses and ID numbers match exactly between like users. If they do not, Moodle will not let you restore the site (because it assumes this is not the same user). Please refer to the attached document for screen shots.

Solution #1 (requires access to Moodle database)

Follow these steps:

  1. Point your browser to http://archive.ccle.ucla.edu
  2. Log in with your Site Admin username and password.
    (If you do not know your username and password or don’t have one, contact Deborah Kearney at: dkearney@oid.ucla.edu.)
  3. If you are a Support Admin, contact your supervising Site Admin for assistance.

In order to change users’ email addresses, you will need Site Admin access on the Archive server (see Step 2 above) and the knowledge of how to edit the Moodle database. Please contact Caroline Tam Kong (caroline@ssc.ucla.edu) or Nick Thompson (nthompson@oid.ucla.edu) for help.

Soution #2 (does not require access to Moodle database)

Follow these steps:

  1. Point your browser to http://archive.ccle.ucla.edu
  2. Log in with your Site Admin username and password.
    (If you do not know your username and password or don’t have one, contact Deborah Kearney at: dkearney@oid.ucla.edu.)
  3. If you are a Support Admin, contact your supervising Site Admin for assistance.
  4. Extract moodle.xml from the backup set.
  5. Open moodle.xml in a text editor
  6. Each user record is enclosed in tags. Check the offending user by ensuring that everything between the associated tags matches the user account on PROD (ensure email or firstaccess fields match with the ones in target site).
  7. Save and close moodle.xml
  8. Replace the moodle.xml in the backup set with the updated moodle.xml and zip the folder.
  9. Run the course restore using the updated backup set.

Note: Since Moodle 1.9.7 all user fields must exactly match between all the instances of the same courses residing on different servers in order for restore to work.