# User synchronization **Moodle → User synchronization** transfers student data from EduSystems to Moodle. An account is not course enrollment and does not grant a system-wide administrative role. ## Source and synchronized fields EduSystems owns email, first/last name, patronymic, main/additional phones and six academic values (see [Profile fields](/en/docs/moodle-user-fields)). Names use the institution default language, falling back to available translations. Phone code and number are combined when both exist. Academic values come from the active academic course and its educational status; faculty comes from profession. Unset academic values clear the corresponding field rather than retain stale values. Moodle matches a nondeleted account by email. First synchronization creates an account; another with the same address updates name, state and fields. When the email changes, do not assume the old account is renamed automatically: matching uses the current email. Coordinate any duplicate correction with the administrator to preserve learning and grades. EduSystems passwords are not copied as Moodle passwords. ## Events and states | EduSystems operation | Expected Moodle state | | --- | --- | | Create student | Create or update account | | Update | Refresh profile values | | Delete student record | Suspend account, not delete Moodle profile | | Restore | Unsuspend and refresh | | Re-enable LMS | Reconcile options, then all students including soft-deleted records | Reconciliation is queued, so updates may be delayed. Do not promise suspension for every arbitrary educational status name: current integration distinguishes deletion from an ordinary update, and academic fields describe affiliation rather than login state. Do not resolve suspension by creating another account. ## Example and verification 1. In [Student details](/en/docs/student-details) verify fictional anna@example.test has a name, active trajectory and status with correct year/course. 2. After synchronization, open Moodle → Site administration → Users → Browse list of users. Find the exact email and open the profile with an authorized account. 3. Verify name, academic fields and suspended state; check course enrollment separately. After course progression the new value should appear when processed, but this synchronization does not automatically remove previous Moodle enrollments. 4. If absent, check email, translations, synchronized options and LMS availability. The authorized operator can repeat reconciliation via the supported moodle:sync-students process (batching supported). Correct the fault before retrying. Bulk reconciliation covers the whole institution, not a staff member's faculty/profession scope; only an authorized operator should run it. Moodle roles and capabilities govern Moodle access. System-context manager/student/teacher roles are no longer auto-assigned by the project; course enrollment is separate. See [Preparation](/en/docs/moodle-web-services), [Course fields](/en/docs/moodle-course-fields). ## Implementation sources - [SyncStudentsCommand.php](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/Moodle/Console/Commands/SyncStudentsCommand.php) - [SyncStudentToMoodleJob.php](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/Moodle/Jobs/SyncStudentToMoodleJob.php) - [ReconcileStudentsToMoodleJob.php](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/Moodle/Jobs/ReconcileStudentsToMoodleJob.php) - [MoodleApiService.php](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/Moodle/Services/MoodleApiService.php) - [SyncStudentToMoodle.php](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/Moodle/Listeners/SyncStudentToMoodle.php) - [user_sync_api.php](https://gitlab.kamoorj.com/development/moodle_plugins/-/blob/78752be8122742bab259dd2d6a58602547048aed/local/userfields/classes/external/user_sync_api.php) - [StudentReconciliationTest.php](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/tests/Feature/Moodle/StudentReconciliationTest.php)