Missing users after restore.

Missing users after restore.

by Ahmad Faridi -
Number of replies: 2

Hi All,

I have two moodle 2.6.4 systems installed on two different servers. I want to keep a back up copy of one of the courses from one server and restore it in the other. For most of the courses that I have done so far everything seems to be restored properly. 

However, I noticed that for some courses some users are missing from the restored course. I have checked the .mbz file that the backup create. The missing users seem to be recorded in the users.xml and their enrollments are there also in enrollment.xml. I also checked their enrollment methods. All the users are manually enrolled. 

I am wondering if anyone have faced this issue before and what are the steps to fix this. 

Thank You

Average of ratings: -
In reply to Ahmad Faridi

Re: Missing users after restore.

by Susan Fleming -

We are encountering a similar problem when restoring older courses with user data. 

When the users have been deleted (but are still in the user database according to our technical support), they do not restore when courses are restored with user data.  The user data is in the course backup files (versions 2.3, 2.5, 2.6).

When I research the Moodle docs, I found these links which suggest that user data can be created on restore:
https://docs.moodle.org/27/en/Course_restore
https://docs.moodle.org/27/en/Capabilities/moodle/restore:createuser
https://docs.moodle.org/27/en/Capabilities/moodle/restore:configure
https://docs.moodle.org/27/en/Capabilities/moodle/restore:userinfo

But our technical support also found:

https://docs.moodle.org/27/en/Browse_list_of_users

Warning: Deleting an account results in user data being permanently deleted. If you wish to retain any data, you should instead suspend the user's account.

If an account is deleted by mistake, it can be partially restored by resetting the deleted flag to zero in the database and resetting the username and email address. User profile details, user preferences, enrolments, and group and cohort membership data cannot be recovered. Grades may be recovered by re-enrolling the user into their courses and ticking the 'Recover user's old grades if possible' checkbox in the enrolment options. Forum posts are not deleted.

We are on 2.7