I am using Drupal 7.
I am using the Migrate module to migrate a list of users from an external user database table into the Drupal "users" table. The problem is that the Drupal "users" table has a numerical "uid" field, which does not exist in my external database users table.
Could someone please tell me of a way to assign a unique uid to the users table everytime I map a row using Migrate?
For example, right now I have, in the "users" database:
0 1 root ... //external users start here 2 user1 ... 3 user2 ... 4 user3 ...
Essentially I have would like to start at 2 and continue for each user I migrate over to the "users" table.
More specifically, how I would modify/add a line to the following so that the code can auto generate unique ID's starting from 2? Would the following code be a viable option? If so, where would be the appropriate place to update $counter?
$counter = 2; $this->addFieldMapping('uid', '$counter');
If I were to use the following SQL statement to do the user migration, would it be a good idea? If it is also a viable option, how might be able to create unique "uid" for insertion into the "users" table?
INSERT INTO users (uid, name, mail,pass,...) SELECT uid, oldusername, email, md5(clear_password),... FROM old_users_table;