Answers.Body: <p>In the civicrm_uf_match mysql table</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-07T08:31:03.153Z
Answers.LastActivityDate: 2021-04-07T08:31:03.153Z
Answers.UserDisplayName: eileen
Answers.Body: <p>Great question!</p>
  <p>The matching between the CMS user and the CiviCRM contacts relies, like most &quot;relationships&quot; between entities in CiviCRM, on an additional table that maps the IDs between the two entity types.</p>
  <p>For the Contact to CMS User match you're looking for the <code>civicrm_uf_match</code> table. This table has the following columns:</p>
  <ul>
  <li>ID - <em>this is the Unique ID of the match record.</em></li>
  <li>DOMAIN_ID - <em>this is the Unique ID of the CiviCRM domain in a multisite setup.</em></li>
  <li>UF_ID - <em>this is the User's ID in the &quot;UserFramework (UF)&quot; (this is what CiviCRM calls the CMS).</em></li>
  <li>UF_NAME - <em>this is the User's Username or Email address in the UserFramework.</em></li>
  <li>CONTACT_ID - <em>this is the Unique ID of the CiviCRM contact that matches to the User.</em></li>
  </ul>
  <p>Hope this helps!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-07T10:57:08.250Z
Answers.Text: I accepted this answer as although it was a couple of minutes later, I assume they were writing your answer which had a bit more detail in. I would have accepted both answers if I could, but I gave them both an upvote. Thanks for the quick response from you both!
Answers.UserDisplayName: dading84
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-07T08:35:04.077Z
Answers.LastActivityDate: 2021-04-07T08:35:04.077Z
Answers.UserDisplayName: HomoTechsual
Body: <p>I am migrating my CiviCRM database to a new server with a fresh install of Wordpress and CiviCRM. I would like to know where in the database the link between CiviCRM contacts and Wordpress Users are, so if needs be I can manually correct them (there are not many contacts linked to users in my database).</p>
  <p>Maybe Civi will correct the link between users and contacts if I were to use the 'Synchronize Users to Contacts' feature again in the new system, does anyone have experience of this?</p>
  <p>Regardless I would be interested to know about where this link is stored to improve my familiarity with how Civi works. I looked in the civi_contact table but could not see any field there that might store the linked user id from Wordpress.</p>
  
Tags: <wordpress><contacts><migration>
Title: Where is the link between a CiviCRM contact and Wordpress user stored in the database?
ThreadText: # Where is the link between a CiviCRM contact and Wordpress user stored in the database?
  
  (Asked by: username_0 on 2021-04-07)
  
  I am migrating my CiviCRM database to a new server with a fresh install of Wordpress and CiviCRM. I would like to know where in the database the link between CiviCRM contacts and Wordpress Users are, so if needs be I can manually correct them (there are not many contacts linked to users in my database).
  
  Maybe Civi will correct the link between users and contacts if I were to use the 'Synchronize Users to Contacts' feature again in the new system, does anyone have experience of this?
  
  Regardless I would be interested to know about where this link is stored to improve my familiarity with how Civi works. I looked in the civi\_contact table but could not see any field there that might store the linked user id from Wordpress.
  
  **Tags:** wordpress, contacts, migration
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2021-04-07. Score: 7 | Accepted answer
  
  Great question!
  
  The matching between the CMS user and the CiviCRM contacts relies, like most "relationships" between entities in CiviCRM, on an additional table that maps the IDs between the two entity types.
  
  For the Contact to CMS User match you're looking for the `civicrm_uf_match` table. This table has the following columns:
  
  * ID - *this is the Unique ID of the match record.*
  * DOMAIN\_ID - *this is the Unique ID of the CiviCRM domain in a multisite setup.*
  * UF\_ID - *this is the User's ID in the "UserFramework (UF)" (this is what CiviCRM calls the CMS).*
  * UF\_NAME - *this is the User's Username or Email address in the UserFramework.*
  * CONTACT\_ID - *this is the Unique ID of the CiviCRM contact that matches to the User.*
  
  Hope this helps!
  
  > **Comments:**
  > **username_0**: I accepted this answer as although it was a couple of minutes later, I assume they were writing your answer which had a bit more detail in. I would have accepted both answers if I could, but I gave them both an upvote. Thanks for the quick response from you both!  
  
  ---
  
  ### Answer by username_1 on 2021-04-07. Score: 5
  
  In the civicrm\_uf\_match mysql table
  
  
  ---
  
  