Migrate module. Users from D6 to D7 with preserved UIDs
For migrating to Drupal 7, it's much simpler:

// Pass the old uid through
$this-&gt;addFieldMapping('uid', 'uid');
// Tell user_save to create a new account with the given uid (otherwise it sees the
// uid and assumes you're updating an account).
$this-&gt;addFieldMapping('is_new')
     -&gt;defaultvalue(1);