CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 2.2 Release Testing »
  • Am I Misunderstanding Contact Matching on SQL Import?
Pages: [1]

Author Topic: Am I Misunderstanding Contact Matching on SQL Import?  (Read 3264 times)

farmrchrys

  • I post occasionally
  • **
  • Posts: 92
  • Karma: 2
    • Spokane Moves to Amend the Constitution (under development)
  • CiviCRM version: CiviCRM 4.4.6
  • CMS version: Drupal 7.31
  • MySQL version: MySQL 5.5.37
  • PHP version: PHP 5.3.28
Am I Misunderstanding Contact Matching on SQL Import?
February 08, 2009, 11:54:26 am
I've imported some contact data into an empty civiCRM 2.2 beta database using a csv file, basically name, address and website, but not the email. I did one import for individuals and another for organizations. I had my strict contact matching rules set to use the external identifier (which, as I understand it, is a unique identifier in the data to be imported) but since the database was empty, I chose "no contact matching" for my import. I did import the external identifier as "external identifier" since I thought I would need this when I need to import updated or additional data for my contacts.

My next step was to import my contacts' email addresses. These are in a database that I can use civiCRM's new SQL import feature to import. With my strict matching rules still set to external identifier I attempted to import query results that contained only the external identifiers (identical for all records to the unique identifiers used with the csv file import) and the email address associated with each id. I chose "fill" to "fill additional contact data only".

At the end of the import, no data was imported and I got this in the error csv file : "external identifier already exists in the database".

Well, I knew that and that's why I chose that value to match with the imported data to fill what was already imported. Why didn't that work?

Am I missing something? Am I misunderstanding contact matching altogether?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Am I Misunderstanding Contact Matching on SQL Import?
February 08, 2009, 06:13:39 pm
Your steps sound like they should work as you expect so this might be a bug.

I know that you can't "recreate on sandbox" using SQL import - but AFAIK the core processing for matching during import is the same regardless of whether you use SQL or CSV formats. So if you can recreate using a few sanitized records - and using CSV for both insert and fill - that would be helpful.
Protect your investment in CiviCRM by  becoming a Member!

farmrchrys

  • I post occasionally
  • **
  • Posts: 92
  • Karma: 2
    • Spokane Moves to Amend the Constitution (under development)
  • CiviCRM version: CiviCRM 4.4.6
  • CMS version: Drupal 7.31
  • MySQL version: MySQL 5.5.37
  • PHP version: PHP 5.3.28
Re: Am I Misunderstanding Contact Matching on SQL Import?
February 08, 2009, 11:16:05 pm
Dave,

I played in the sandbox and pretty much the same behavior there. I set the strict matching rules to external identifier only. First imported basic contact info for 500 individuals including Fname, Lname, Street Address, Website etc. including external identifier, (tagged Chrys1) but not email.

Next imported emails using "fill". Turned out, since I pared down the import size from two source files and did this kinda quick, I imported a batch of emails roughly half of which did not match the contacts from the first batch (in fact I had 50 such emails out of 2500 in my real import attempt). In other words, in the test, half of the external identifiers that went in with the email addresses had not been imported with the first import of contact data. These did import and now there are 232 email addresses that have associated external identifiers and no other contact info. These show up as email addresses in the name columns in "find contacts" with no other data. This is what happened with the 50 extra emails in my real scenario.

However, every email address that was properly matched with the external identifier previously imported was rejected and reason given: "external identifier already exists in the database".

Do you think the extra external identifiers threw things off? I don't know why that should be. Seems like, using "fill", the system would add the email addresses for the matching contacts nonetheless (and maybe reject the errant ones for having missing required fields, ie Fname and Lname?).


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Am I Misunderstanding Contact Matching on SQL Import?
February 09, 2009, 05:02:57 pm
Thx for testing on the sandbox! I have recreated this on my 2.2 install as well as filed an issue for 2.2 queue:

http://issues.civicrm.org/jira/browse/CRM-4111

As a side note, if you want to continue your 2.2 testing you can do the 2-stage import as you describe IF you select 'Update' instead of 'Fill' for duplicate handling in step 1 of the import. The bug seems to only affect 'Fill' (in my testing). My understanding is that you are populating email addresses for records that don't already have one - so the net result of using 'Update' rather than 'Fill' should be the same.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 2.2 Release Testing »
  • Am I Misunderstanding Contact Matching on SQL Import?

This forum was archived on 2017-11-26.