Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Usage Milestone: Time Field for Drupal 8+ Module time_field crossed 10,000 active installs. Usage Milestone: Devel PHP Module devel_php crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Moodle Sync

8 sites No security coverage Drupal 10–11
View on drupal.org

This module synchronizes Drupal content with Moodle, allowing entities like users, courses, and taxonomy terms to be mirrored. It creates components in Moodle when Drupal entities are made and updates them upon modification, using configured field mappings to control the data transfer. The module also supports receiving completion data from Moodle.

Moodle Sync

This module syncs drupal entities from Drupal to Moodle via built-in webservices.

There are several separate submodules that handle the sync of Moodle components. Enable all needed modules and configure them appropriately:

- moodle_sync_category: syncs Drupal Taxonomy Terms into Moodle course categories
- moodle_sync_cohorts: syncs references to Drupal Taxonomy Terms into membership of Moodle cohorts
- moodle_sync_completion: receives Moodle completions from Moodle. Needs Moodle module local_completion_push
- moodle_sync_course: syncs Drupal entities into Moodle courses
- moodle_sync_enrollments: syncs Drupal registrations into Moodle user enrollments
- moodle_sync_template: syncs Drupal Taxonomy Terms into Moodle courses, to be used as templates
- moodle_sync_users: syncs Drupal users and profiles to Moodle users

Common concepts

- On Creation of a Drupal entity, the corresponding Moodle component is created
- The Drupal entity ID is written into Moodle component idnumber
- Moodle ID is written back into the Drupal entity's field_moodle_id

- On Updating a Drupal entity, the corresponding Moodle component is looked up via its id from field_moodle_id and updated with all the fields mapped for this component in the module's configuration.
- If no corresponding Moodle component to update is found, nothing will be synced to Moodle.
- If field_moodle_id is empty when updating a Drupal entity, this module will try to create a new component in Moodle

Thus, if you want to stop a particular entity from syncing to Moodle, you can enter an invalid Moodle ID into its field_moodle_id*, eg. "ignore"

Field mappings

- Fields to sync other than the Moodle IDNUMBER and Drupal field_moodle_id can be configured for courses and users these module's settings.
- Categories will always sync field_description to the Category description in Moodle.

How to install

Moodle Configuration

- Enable web services (/admin/search.php?query=enablewebservices)
- Enable rest protocol (/admin/settings.php?section=webserviceprotocols)
- Add a service (/admin/settings.php?section=externalservices)
- Short name = moodle_sync
- Enabled = true
- Authorized users only = true
- For your service, click on authorized users (/admin/settings.php?section=externalservices)
- Add your user (can be the system admin, or any account with sufficient permissions)
- Create a token for this user and service (/admin/webservice/tokens.php)
- Copy that token to the Drupal module configuration
- Add functions to your webservice (/admin/settings.php?section=externalservices)
- core_cohort_add_cohort_members (only used for moodle_sync_cohorts)
- core_cohort_create_cohorts (only used for moodle_sync_cohorts)
- core_cohort_delete_cohorts (only used for moodle_sync_cohorts)
- core_cohort_delete_cohort_members (only used for moodle_sync_cohorts)
- core_cohort_update_cohorts (only used for moodle_sync_cohorts)
- core_course_create_courses
- core_course_create_categories
- core_course_delete_courses
- core_course_duplicate_course
- core_course_get_categories
- core_course_get_courses_by_field
- core_course_update_courses
- core_course_update_categories
- core_enrol_get_enrolled_users
- core_role_unassign_roles
- core_user_create_users
- core_user_delete_users
- core_user_get_users
- core_user_get_users_by_field
- core_user_update_users
- enrol_manual_enrol_users
- enrol_manual_unenrol_users

Drupal Configuration

- Enable module and all submodules that will be used.
- Necessary settings can be found in /admin/config/moodle_sync/settings
- As a safety measure, the current Drupal path has to be given in the module settings. This makes sure that the module stops writing to Moodle if the current Drupal DB is copied to another site, eg for test sites.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Apr 2025
Latest release
2 months ago
Releases (12 mo)
2 ▲ from 1
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.1.1 Stable 10–11 Jun 9, 2026
1.1.0 Stable 10–11 May 12, 2026
1.0.0 Stable 10 Apr 4, 2025