Pre-Enrollment Rediness
Goal: make sure the new semester site is clean and aligned, before the Database Enrollment plugin starts pulling users.
1, put site in maintenance while you prep
/usr/local/lsws/lsphp82/bin/php /moodleweb/moodle/{platformname}_{semester}/admin/cli/maintenance.php --enable
2, config sanity checks
- config.php points to the right DB and dataroot:
$CFG->dbname = 'production_{platformname}_{semester}'; $CFG->dataroot = '/moodledata/{platformname}_{semester}'; /* or /data/{platformname}_{semester} */
- wwwroot matches the new semester URL, example:
$CFG->wwwroot = 'https://{platformname}.umt.edu.my/{semester}';
- Ownership on web and data paths looks right for OpenLiteSpeed user, yours is usually
nobody:nogroup
orwww-data:www-data
chown -R nobody:nogroup /moodleweb/moodle/{platformname}_{semester} chown -R nobody:nogroup /moodledata/{platformname}_{semester} 2>/dev/null || true chown -R nobody:nogroup /data/{platformname}_{semester} 2>/dev/null || true
3, core health, quick run
/usr/local/lsws/lsphp82/bin/php /moodleweb/moodle/{platformname}_{semester}/admin/cli/purge_caches.php
/usr/local/lsws/lsphp82/bin/php /moodleweb/moodle/{platformname}_{semester}/admin/cli/check_database_schema.php
/usr/local/lsws/lsphp82/bin/php /moodleweb/moodle/{platformname}_{semester}/admin/cli/cron.php
4, course identity alignment
- Open a few courses, confirm Course idnumber matches SIS or your external DB value for this semester
- Keep idnumber stable, shortname can be human friendly and may change later
5, enrollment plugin is pointed to the right semester tables
- Site administration, Plugins, Enrolments, External database
- DB name:
elearning_dashboard
- Course table:
course_{platformname}_{semester}
, local course field =idnumber
, remote course field =course_idnumber
(or your chosen mapping) - Enrollment table:
enrollment_{platformname}_{semester}
, local user field =username
oridnumber
to match your data, remote user field the same - Role mapping is set, example student, editingteacher, noneditingteacher
- Consider leaving “unenrol missing” off until add drop window ends
6, SSO works first
- Test login with one lecturer and one student from IdP
- Confirm their Moodle profile field used for mapping, username or idnumber, actually matches what is in
enrollment_{platformname}_{semester}
7, scheduled task window
- Site administration, Server, Scheduled tasks, check “Synchronise enrolments task” is enabled
- For a first controlled run, execute it manually
/usr/local/lsws/lsphp82/bin/php /moodleweb/moodle/{platformname}_{semester}/admin/cli/scheduled_task.php --execute=\enrol_database\task\sync_enrolments
- Review logs, fix mapping if anything is off, then let cron run normally
8, spot checks, just a few
- Open 2 to 3 courses, Participants page, confirm expected students and teachers
- Check one cohort if you use cohorts, membership looks right
9, take site out of maintenance when ready
/usr/local/lsws/lsphp82/bin/php /moodleweb/moodle/{platformname}_{semester}/admin/cli/maintenance.php --disable
10, optional guardrails for the first week
- Keep “unenrol missing” off during add drop week
- Run enrollment sync every hour, or your normal cadence, then switch to daily later