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) »
  • Any way to import/update based on Drupal user ids?
Pages: [1]

Author Topic: Any way to import/update based on Drupal user ids?  (Read 1668 times)

civicpixel

  • I’m new here
  • *
  • Posts: 25
  • Karma: 3
Any way to import/update based on Drupal user ids?
March 21, 2009, 09:31:12 am
We're at channelAustin working on helping them move their old membership database data to CiviCRM as part of the Open Media Project (http://groups.drupal.org/open-media-project). All of the data in their old database revolves around user ids, which we've imported into Drupal as user accounts (so old ids now == drupal user ids). We synchronised the drupal accounts to contact records in CiviCRM, so we now have about 1200 contact records that consist of nothing more than a display name and in some cases also an email address. We have a dozen or so csv's containing the rest of the individual information (names, addresses, etc) -- but the challenge is we have no unique field to import/update based on besides the drupal user id which isn't available in the CiviCRM import.

Ideally there would be a way to update contacts based on matching drupal user id, so my first question is whether or not that might be possible somehow.

Otherwise, the ideas we have would be to either:
A. Copy the Drupal UserID into the External ID field, and use that to match. Only challenge we see with that is that they will be running both systems in parallel for awhile and when they import or add new contacts in CiviCRM the External ID field won't automatically receive the Drupal userid, and then future synchronizations between the two databases won't work.

or

B. Add fake email addresses for all of the contacts that don't have an email address, and then add the same fake email address to the other database. Then we could match based on email.. and it is more likely that all new contacts added will have an email address..

We'd love to hear if anyone has any better ideas...

Thanks!
Brian

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Any way to import/update based on Drupal user ids?
March 21, 2009, 12:14:50 pm

1. any reason why you are creating drupal user ids without a good handle (i.e. email address) of the user? does that get you anything?

2. I think option 2 as you've suggested might be a better option.

3. However if you do want to match on drupal userID, you could potentially hack the import dupe check code at: api/v2/utils.php, function _civicrm_duplicate_formatted_contact

lobo



A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

civicpixel

  • I’m new here
  • *
  • Posts: 25
  • Karma: 3
Re: Any way to import/update based on Drupal user ids?
March 21, 2009, 04:39:06 pm
Thanks Lobo --

For 1, the data in their old database often doesn't have an email account associated with it. We have to import the accounts first into Drupal, which means we're limited to username & userid when we sync those accounts with CiviCRM. So that's why we're ending up with accounts in CiviCRM that have nothing but a drupal user id/display name. (Drupal forces email address on new registrations, but does allow accounts without email addresses from a manual import).

We'll try option 2, and see if we can find a sustainable way for the client to recreate the process after we're gone. Otherwise I'll play with the function in utils.php

Brian

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Any way to import/update based on Drupal user ids?
March 21, 2009, 06:12:51 pm

yes, but whats the need for a drupal user account? are those folks going to be sent a snail mail letter inviting them to sign up? not sure i understand the need for a drupal account at that stage

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Any way to import/update based on Drupal user ids?

This forum was archived on 2017-11-26.