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) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Importing by ID
Pages: [1]

Author Topic: Importing by ID  (Read 1106 times)

EdP

  • I post frequently
  • ***
  • Posts: 260
  • Karma: 7
  • CiviCRM version: 4.4
  • CMS version: Joomla 2.5.x
Importing by ID
November 21, 2012, 04:54:02 am
I am importing from one Civi database to a new one (worried about data corruption in the first one). The target database has the source database InternalID as the ExternalID for each contact.

However, I need to update all the contacts (some data has changed, some needs filling in) so I want to do a contact import and update on the existing contacts in the target database.

I want to acheive the situation where the import is only using the given ID as the test and will overwrite/fill in regardless of what it there already, without creating duplicates or doing any different duplicate check (which are prone to go wrong, since fathers/sons in the same house share email addresses and are therefore very difficult to de-dupe any other way).

I had thought to do this with a strict de-dupe rule that only tested InternalID (or externalID) but these don't seem to work and duplicates of everyone are created.

Any suggestions, thanks?

Jason W

  • I post frequently
  • ***
  • Posts: 197
  • Karma: 12
  • jason@civitrainingtutorials.com
  • CiviCRM version: 4.2
  • CMS version: Drupal 7
  • MySQL version: 5.x
  • PHP version: 5.x.x
Re: Importing by ID
November 21, 2012, 09:51:46 am

Hello EdP,

My suggestion would be to go ahead and import your contacts, and then dedupe the contacts once they are already in Civi. You could then use a strict rule to find the dupes and go from there.

Cheers,
Jason
civiTrainingTutorials
"Helping You Help Others"

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Importing by ID
November 21, 2012, 07:00:09 pm
Ed - I would expect it to work as you described with External ID. Does the 'rule' work to 'Find Duplicates' when you run it (and you have contacts w/ the same Ext ID?

As another thought, did you already try just using the "External ID (match to contact)" with the default strict rule? Not sure how it will behave if you're also importing Email addresses.
Protect your investment in CiviCRM by  becoming a Member!

EdP

  • I post frequently
  • ***
  • Posts: 260
  • Karma: 7
  • CiviCRM version: 4.4
  • CMS version: Joomla 2.5.x
Re: Importing by ID
November 22, 2012, 05:05:39 am
Quote from: Jason W on November 21, 2012, 09:51:46 am
My suggestion would be to go ahead and import your contacts, and then dedupe the contacts once they are already in Civi. You could then use a strict rule to find the dupes and go from there.

Jason - thanks, but that ends up being (a) very messy, (b) a lot of deduping on 2,500 contacts each of whom may appear several times and (c) doesn't work with e.g. fathers/sons who may have the same name, email and address.

Dave - it didn't seem to, hence my enquiry. Will have a go with the general rule as you suggest.

Thanks both.

Ed

flug

  • I post frequently
  • ***
  • Posts: 126
  • Karma: 12
Re: Importing by ID
December 18, 2012, 05:07:07 pm
Quote from: EdP on November 21, 2012, 04:54:02 am
I had thought to do this with a strict de-dupe rule that only tested InternalID (or externalID) but these don't seem to work and duplicates of everyone are created.

Any suggestions, thanks?

My recollection when I experimented with this was that if the foreign key exists then it is matched according to that and you do NOT need to include a rule for foreign key matching in the dedupe rule you select on import.  A similar thing seemed to happen if internal contact id existed.

In fact my recollection is that it worked better if you just used no dedupe rule at all  vs one that included foreign key and/or contact id.

I'm not sure I experimented with this enough to get a total feel for how it actually works, but my impression from that would be, just include a foreign key (or contact id, but preferably NOT BOTH!), DON'T select any de-dupe rule, and see how that works.

Make sure to select "update" duplicate contacts (though you could also experiment with 'no duplicate checking'--again my impression when I was experimenting was the internal contact id or external id would automatically merge the records where those matched, regardless of dedupe rule or settings--though again I could be wrong).

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Importing by ID

This forum was archived on 2017-11-26.