Answers.Body: <p>Glad it worked! CiviCRM uses the civicrm_uf_match table to store the Drupal ID in the column uf_id (user framework id) and also the CiviCRM contact_id.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-11T08:00:17.557Z
Answers.LastActivityDate: 2017-04-11T08:00:17.557Z
Answers.UserDisplayName: ErikH - CiviCooP
Answers.Body: <p>I used MySQL commands to migrate the user tables from Drupal and the whole CiviCRM database and when I re-synced the users, they matched up the same way because the data, such as the UID, wasn't changed. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-11T05:06:15.767Z
Answers.LastActivityDate: 2017-04-11T06:13:52.990Z
Answers.LastEditDate: 2017-04-11T06:13:52.990Z
Answers.UserDisplayName: Christia
Body: <p>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. </p>
  
  <p>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. </p>
  
  <p>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.</p>
  
Tags: <drupal><civimember><user>
Title: Migrating Drupal Users and CiviCRM Data to New Website
ThreadText: # Migrating Drupal Users and CiviCRM Data to New Website
  
  (Asked by: username_0 on 2017-03-29)
  
  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.
  
  **Tags:** drupal, civimember, user
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2017-04-11. Score: 2 | Accepted answer
  
  Glad it worked! CiviCRM uses the civicrm\_uf\_match table to store the Drupal ID in the column uf\_id (user framework id) and also the CiviCRM contact\_id.
  
  
  ---
  
  ### Answer by username_0 on 2017-04-11. Score: 1
  
  I used MySQL commands to migrate the user tables from Drupal and the whole CiviCRM database and when I re-synced the users, they matched up the same way because the data, such as the UID, wasn't changed.
  
  
  ---
  
  