Hani Ayyoub
Lead Developer and Maintainer
local_userdatasync is a Moodle local plugin that synchronizes selected Moodle user profile fields from an external database table or view into Moodle user accounts. The plugin is designed for universities, schools, and organizations that maintain user information in institutional systems such as SIS, ERP, HR, or identity management databases and need Moodle user data to remain synchronized automatically.
The plugin supports configurable field mapping, scheduled synchronization tasks, dry-run testing, validation controls, synchronization logging, and external database connectivity using Moodle’s bundled ADOdb library.
Synchronizes Moodle user profile fields from an external database.
Supports Oracle, MySQL/MariaDB, PostgreSQL, and SQL Server external sources.
Uses Moodle scheduled tasks for automated synchronization.
Configurable local and remote matching fields.
Configurable field mappings for Moodle profile fields.
Supports selected custom profile fields.
Dry-run mode for testing synchronization safely.
Optional validation for email addresses and phone numbers.
Batch processing and pagination support for large datasets.
Synchronization audit and reporting interface.
External database connection testing page.
Privacy API support for metadata, export, and deletion.
Secure identifier validation for external database tables and columns.
This plugin is useful in environments where Moodle user profile data should reflect authoritative institutional systems automatically.
Example scenarios include:
Synchronizing student information from a university Student Information System (SIS).
Updating staff profile information from an HR database.
Synchronizing phone numbers, departments, or institutional profile fields.
Maintaining Moodle profile consistency across large organizations.
Reducing manual user profile maintenance by administrators.
The plugin supports synchronization for standard Moodle profile fields such as:
firstname
lastname
phone1
phone2
department
institution
It also supports selected custom profile fields through configurable mappings.
The plugin supports external database connections using Moodle’s bundled ADOdb library.
Supported database types include:
Oracle (oci8, oci8po)
MySQL / MariaDB
PostgreSQL
Microsoft SQL Server
Administrators can configure:
External database type
Hostname
Database/service name
Username and password
Source table or view
Matching fields
Field mappings
The plugin includes:
Capability-based access control
Login protection for admin pages
POST-only connection testing
Sesskey validation
Privacy API metadata and deletion support
Safe validation of external identifiers
Synchronization audit logging
The plugin is intended to minimize sensitive data exposure and avoids storing unnecessary personal values in synchronization logs.
The plugin provides scheduled tasks for:
User profile synchronization
Synchronization log cleanup
Administrators can execute tasks manually through Moodle CLI or allow Moodle cron to process them automatically.
Moodle 4.1+
Intended for Moodle 4.3, 4.4, 5.0, 5.1, and 5.2
Compatible with Moodle-supported PHP versions for these releases
Hani Ayyoub
Lead Developer and Maintainer