diff --git a/backup/moodle2/backup_stepslib.php b/backup/moodle2/backup_stepslib.php
index <HASH>..<HASH> 100644
--- a/backup/moodle2/backup_stepslib.php
+++ b/backup/moodle2/backup_stepslib.php
@@ -372,6 +372,7 @@ class backup_enrolments_structure_step extends backup_structure_step {
         // User enrolments only added only if users included
         if ($users) {
             $enrolment->set_source_table('user_enrolments', array('enrolid' => backup::VAR_PARENTID));
+            $enrolment->annotate_ids('user', 'userid');
         }
 
         $enrol->annotate_ids('role', 'roleid');
MDL-<I> course enrolment backup - we may actually have users enrolled but without roles such as in LDAP plugin