by Fadi Mansour.
UPDATE
First of all, there's an error in my previous message, most of my users were enrolled by enrol/database not auth/db.
Second: The problem seem to have been caused by a problem in the restoration of the mdl_enrolments table.
I reviews the output from the SQL restore command and there seem to have been an error while restoring that table, hence the missing enrollments.
The solution for me was to re-run the command line command to sync enrollments with the external database.