Drupal Migrate - Assign Roles I'm creating a Migration from our old website (non-Drupal) to our new Drupal website. On our old website, roles and role assignments were kept in 2 seperate tables. So far, I've written a simple UserMigration and a RoleMigration class. However, I'm in doubt how I should proceed for the RoleMembershipMigration.

In short: Should I manually load roles in a prepare function for the UserMigration, or should this be done in a seperate Migration class altogether? I'm inclined towards the first, since it is not actually a migration to a seperate entity.
I suggest to join roles and role assignements tables togother in your query of RoleMigration class, 
in that case you will have these fields as source fields : role_id, user_id, role_name

now in UserMigration you just need to apply the dependency of the role migration on "roles" field :

$this-&gt;addFieldMapping('roles', 'role_name')
            -&gt;sourceMigration('Role')
            -&gt;defaultValue(drupal_map_assoc(array(2))); // authenticated user default value


Don't forget also that the key field of migration mapping should be the user_id field :

$this-&gt;map = new MigrateSQLMap($this-&gt;machineName,
        array('user_id' =&gt; array(
                'type' =&gt; 'int',
                'not null' =&gt; TRUE,
                'description' =&gt; 'User ID.'
                )
            ),
        MigrateDestinationUser::getKeySchema()
    );


Didn't test it but should work like that!