Trying to restore user from backup file will cause conflict - solution

Trying to restore user from backup file will cause conflict - solution

by Susan Fleming -
Number of replies: 0

Hello

Some back ground, last summer we switch all our users over to student numbers from personally selected usernames and since then we have been running into problems when we attempt to restore courses with user data due to conflicts. 

restore user causes conflict

I thought I would share the solution we came up with


  1. Make a copy of course backup file, so you have the original if needed
  2. Change extension to .zip
  3. DON’T unzip
  4. Locate .xml file to be modified - users.xml when restoring courses returning this error (see example above):
  • Trying to restore user '357xyz' from backup file will cause conflict
  • Trying to restore user 'abc246' from backup file will cause conflict
Open into NotePadCopy content to Word - it is easier to read and the search function usually works better
Search each individual conflict error in the .xml fileIn Moodle > System Admin > Users > Accounts > Browse List of Users > Show More… > Search Surname if possible, alternately search Username – should come up with 2 records for the same userClose eye on record with larger last active period  (1 year 84 days)Copy Username from most recently active record  (285 days) into the Word document to replace the conflicting usernameOnce all changes are made > Select-All > Copy > Paste into the Notepad to replace existing html codeSave - don't use Save As
Find saved file in File ManagerCopy filePaste to back up file with the .zip extension; when prompted, select Copy and ReplaceChange the file extension back to .mbz Restore update .mbz course into MoodleRelabel the modified course if desired and copy into appropriate backup folder


Average of ratings: Useful (2)