Because of the way the synchronization process works with the UF_Match table, deleting records can be tricky business. If done in the incorrect order, your CiviCRM database can end up with a bunch of Junk contact records. Below is a best practice process for removing records, first the Drupal user record should be deleted then the CiviCRM record.
Process to Follow
Step 1 - Identify the Identify the Contact record(s) to be merged/removed in CiviCRM and note the Drupal User ID for the record to be removed.
Step 2 - Search for and locate the Drupal record for the CiviCRM Contact you are deleting that you identified in Step 1 and use the Cancel Account button to delete the Drupal User record.
Step 3 - Go back to CiviCRM and merge/delete the CiviCRM Contact record.
Step 1
- Identify the Contact record(s) to be merged/removed in CiviCRM.
- Determine the record which is to be removed and note the Drupal User ID.
Step 2
- From the Drupal People screen, locate the User record to be removed. Note that the Drupal ID number should match the User ID from the CiviCRM Contact record.
- At the bottom of the Edit/Account tab, choose Cancel account.
Step 3
- Merge/Remove the CiviCRM Contact record(s) as normal in CivCRM.
Restoring a CiviCRM record from Trash
If you have accidently deleted a Contact record from CiviCRM, you should follow the process in the order outlined below to restore the contact and reestablish a Drupal User account.
Process to Follow
- Step 1 - Restore the CiviCRM Contact record from the trash.
- Step 2 - Establish the connection to a Drupal User account.
If you have not yet deleted the Drupal User account that was associated with the deleted CiviCRM record and you edit the Drupal User account (from Drupal) that was associated previously, Drupal will reestablish the link to the CiviCRM record.
If there is not an existing Drupal User account, you can create a new Drupal user account for the record through the normal CiviCRM process.
Contact Donna Whitig (dwhitig@backofficethinking.com) from www.BackOfficeThinking.com with any questions
Comments
Note that the default "unsupervised" Individual rule is used when the syncronization takes place. Folks should plan their "drupal user registration" profile accordingly.
Rather than looking for the matching user in the cms - note that the user id number (in your example 7184) is a clickable link going to the user account, where you can delete it directly.
Good point! Thanks!
When you were talking about removing/merging contacts you made me think of something I built. It's a module that integrates with the User Merge module called CiviCRM User Merge. If merging two drupal users into one (including the civicrm contact), this is a great way to go.
It *shouldn't* be too hard to create a Drupal Rule that disables the Drupal User on contact-trash & deletes the Drupal User on Contact Delete. I think the parts are there in the civicrm_entity module. The downside of the rule option is that there might be reasons not to want it