Answers.Body: <p>How are you trying to create these Drupal user accounts? We have used <code>User Import module</code> : <a href="https://www.drupal.org/project/user_import" rel="nofollow">https://www.drupal.org/project/user_import</a> - for this and it works great. It's really neat in that you can export a Group of Contacts from your CiviCRM -> batch CSV upload them into Drupal using user_import module + create AccountNames (e.g. FirstNameLastName format) and/or dispatch links to everyone as you create their accounts. </p>
  
  <p>For details please see here: <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Creating+a+Drupal+user+for+every+CiviCRM+contact" rel="nofollow">https://wiki.civicrm.org/confluence/display/CRMDOC/Creating+a+Drupal+user+for+every+CiviCRM+contact</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-06T09:10:29.470Z
Answers.Text: Thanks. Apologies for disappearing for about two months! I have used user_import at times in the past to great success.  My issue is that I wanted to let my Civi contacts choose whether to create an account for themselves in Drupal, so that I didn't have hundreds of inactive accounts in Drupal that no one wanted.  It's when one of those contacts goes to create their own Drupal account that the problem occurs.
Answers.UserDisplayName: Lewis
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-10T17:40:23.873Z
Answers.LastActivityDate: 2016-07-10T17:40:23.873Z
Answers.UserDisplayName: KarinG - Semper IT
Answers.Body: <p>Already exists could be in one of two places: Creating the civi contact or creating the uf record.</p>
  
  <p>I suspect it's the latter, but play with the api to confirm. Also, turn on stack trace (debug settings), retry, and post the full output here.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-06T18:54:27.563Z
Answers.LastActivityDate: 2016-09-06T18:54:27.563Z
Answers.UserDisplayName: JohnFF
Answers.Body: <p>This question is a few years old now, but I faced the same problem today when creating a new user account in Drupal. We're running CiviCRM 5.x and Drupal 7.x.</p>
  
  <p>I got around the issue by firstly deleting the offending user account in Drupal and then going to the contact record in CiviCRM of the person that I was trying to create a user account for. In the contact record, click on the 'Actions' button and then select 'Create User Record'. Fill out the necessary fields and create the user account. Everything then worked beautifully.</p>
  
  <p><a href="https://i.sstatic.net/uZ2AD.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/uZ2AD.png" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-14T13:10:48.947Z
Answers.LastActivityDate: 2019-06-14T13:10:48.947Z
Answers.UserDisplayName: Rich Smith
Body: <p>I'm running CiviCRM 4.7.10 and Drupal 7.50.</p>
  
  <p>I have had a Civi database for a while, but am now wanting to give people front end accounts in order to use some features there.</p>
  
  <p>My problem is that when a user, who is already a contact in Civi, tries to create a Drupal account, they get the rather unceremonious "DB error: already exists".</p>
  
  <p>I'm confused because I keep reading that Civi is set up to automatically merge new users with existing contacts on matching emails (or whatever criteria is set in the Unsupervised deduping settings for Individuals - mine is using email only at the moment).</p>
  
  <p>I would love to understand how this is supposed to work and how to fix it when it doesn't.</p>
  
  <p>Thanks,
  Lewis</p>
  
Tags: <drupal><user><integration><duplicate-contacts>
Title: "DB error: already exists" when creating a Drupal user who already exists as a Contact in CiviCRM
ThreadText: # "DB error: already exists" when creating a Drupal user who already exists as a Contact in CiviCRM
  
  (Asked by: username_0 on 2016-07-10)
  
  I'm running CiviCRM 4.7.10 and Drupal 7.50.
  
  I have had a Civi database for a while, but am now wanting to give people front end accounts in order to use some features there.
  
  My problem is that when a user, who is already a contact in Civi, tries to create a Drupal account, they get the rather unceremonious "DB error: already exists".
  
  I'm confused because I keep reading that Civi is set up to automatically merge new users with existing contacts on matching emails (or whatever criteria is set in the Unsupervised deduping settings for Individuals - mine is using email only at the moment).
  
  I would love to understand how this is supposed to work and how to fix it when it doesn't.
  
  Thanks,
  username_0
  
  **Tags:** drupal, user, integration, duplicate-contacts
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2016-07-10. Score: 1
  
  How are you trying to create these Drupal user accounts? We have used `User Import module` : <https://www.drupal.org/project/user_import> - for this and it works great. It's really neat in that you can export a Group of Contacts from your CiviCRM -> batch CSV upload them into Drupal using user\_import module + create AccountNames (e.g. FirstNameLastName format) and/or dispatch links to everyone as you create their accounts.
  
  For details please see here: <https://wiki.civicrm.org/confluence/display/CRMDOC/Creating+a+Drupal+user+for+every+CiviCRM+contact>
  
  > **Comments:**
  > **username_0**: Thanks. Apologies for disappearing for about two months! I have used user_import at times in the past to great success.  My issue is that I wanted to let my Civi contacts choose whether to create an account for themselves in Drupal, so that I didn't have hundreds of inactive accounts in Drupal that no one wanted.  It's when one of those contacts goes to create their own Drupal account that the problem occurs.  
  
  ---
  
  ### Answer by username_2 on 2016-09-06. Score: 1
  
  Already exists could be in one of two places: Creating the civi contact or creating the uf record.
  
  I suspect it's the latter, but play with the api to confirm. Also, turn on stack trace (debug settings), retry, and post the full output here.
  
  
  ---
  
  ### Answer by username_3 on 2019-06-14. Score: 0
  
  This question is a few years old now, but I faced the same problem today when creating a new user account in Drupal. We're running CiviCRM 5.x and Drupal 7.x.
  
  I got around the issue by firstly deleting the offending user account in Drupal and then going to the contact record in CiviCRM of the person that I was trying to create a user account for. In the contact record, click on the 'Actions' button and then select 'Create User Record'. Fill out the necessary fields and create the user account. Everything then worked beautifully.
  
  [![enter image description here](https://i.sstatic.net/uZ2AD.png)](https://i.sstatic.net/uZ2AD.png)
  
  
  ---
  
  