We are building a new Drupal 7 website but have an existing one with some deprecated features and custom code that we no longer wish to salvage for various reasons. I have established the new Drupal site and installed the same version of CiviCRM that we are using currently. The new site has the same CiviCRM configurations, extensions and integration modules and I am ready to import the CiviCRM database into it, which is no issue.
The next step is to finish setting up the new Drupal site and import the users from the old site. Once the users are migrated into the new site, I will re-sync the user accounts with CiviCRM.
What I want to know is, how does CiviCRM determine which contact record to sync the Drupal account with and what does it do in the case of duplicates? I need to make sure membership access is applied correctly to the same user accounts.