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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Importing Drupal users into CiviCRM
Pages: [1]

Author Topic: Importing Drupal users into CiviCRM  (Read 2501 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Importing Drupal users into CiviCRM
March 14, 2008, 11:07:19 am
Hi, I recently installed 2.0beta5 over Drupal.  It seems the installation script imports all Drupal users into the CiviCRM database and yay for that.  However, following several failed imports of over 6000 individuals and organizations and assorted do-overs, the import of the Drupal users was lost and their records deleted somewhere along the line. 

I want to reimport everyone who has a Drupal account (the staff of our company) so they also have an account in CiviCRM.  I know my SQL, but there are so many damn tables I don't know where to begin.  Can someone please point me in the right direction to a table or SQL statement that I may use to attempt this reimport?

Thank ye kindly, :D
Stuart
Try CiviTeacher: the online video tutorial CiviCRM learning library.

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Importing Drupal users into CiviCRM
March 14, 2008, 11:29:15 am
Hi,

Can you not do what you are talking about by going to CiviCRM >> Administer CiviCRM

Then under the Manage section choose: » Synchronize Users to Contacts

This creates contact records for all drupal users who don't have one, successfully aligning your Drupal users and CiviCRM.

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Importing Drupal users into CiviCRM
March 14, 2008, 02:48:12 pm
I just tried this.  The web interface said 7 users were imported.  However, none of our staff are showing up as contacts.  I can't find any of them listed in the contacts.  I don't know who was imported (which 7), CiviCRM didn't say.

Any other ideas?

Stuart

Try CiviTeacher: the online video tutorial CiviCRM learning library.

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: Importing Drupal users into CiviCRM
March 14, 2008, 03:18:39 pm

You might want to add the contacts to a group during import. that will give you an idea of what contacts succeeded. Alternatively you can just look in the db and see the last added contacts (by contact_id)

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

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Importing Drupal users into CiviCRM
March 15, 2008, 11:24:20 pm
Ok thanks, I have looked into the database,  indeed 7 of our Drupal users were imported into the CiviCRM database.  However the other 6 were not.  I cannot find an explanation as to why.  I went ahead and manually added (using PHPMySQLAdmin) the 6 users that were not imported into civicrm_contact , but the hash field

Code: [Select]
hash  Key for validating requests related to this contact.

Is blank, I didn't know how or what to put there, so will this work?  Should I just truncate the civicrm_contact table and try again with the reimport?

Stuart
 
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Importing Drupal users into CiviCRM
March 17, 2008, 12:01:09 am
Stuart:

If you want to re-import data, we strongly recommend to use "Delete Contacts" functionality rather than PMA truncate option.

HTH,

kurund
Found this reply helpful? Support CiviCRM

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Importing Drupal users into CiviCRM
March 19, 2008, 04:07:25 pm
Well thanks for the advice guys, but still having problems.  Unfortunately prior to posting here I already truncated the contacts table and since that time these 6 drupal users will not import no matter what I seem to do.  So, somewhere in the database there is a record of these 6 drupal users somewhere OTHER than in the contacts table that is causing import to fail.  Where is it so I can remove their records and attempt to re-import?

Thanks yo!

« Last Edit: March 19, 2008, 04:09:55 pm by Stoob »
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Importing Drupal users into CiviCRM
March 19, 2008, 09:30:40 pm
Stuart:

What do mean by import fails? Are you using Import Contact functionality? What are the errors that you get?

kurund
Found this reply helpful? Support CiviCRM

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Importing Drupal users into CiviCRM
March 20, 2008, 12:03:44 am
Ok so, when I installed CiviCRM is imported all the 9 Drupal users into CiviCRM.  Shortly thereafter I truncated the 'civicrm_contacts' table.  I know that is not a good I idea but I didn't know better at the time.  So that's what I did. 

Then (after I did the truncate) 7 more Drupal users were added in Drupal.

Then I used the "Synchronize Users to Contacts" function within CiviCRM.  When I did so it told me:

Code: [Select]
Synchronize Users to Contacts completed. Checked 16 user records. Found 9 matching contact records. Created 7 new contact records.

Then 7 of our Drupal users could use CiviCRM and 9 (the original 9) could not.  When I say "cannot use" I mean that they login to Drupal, and that works.  Then they click "CiviCRM" in the Drupal navigation and the link won't work.  They click it, and nothing happens.  They don't get the CiviCRM main menu, just nothing happens.

Then I went in and deleted the new 7 by deleting their rows from the 'civicrm_contacts' table.  Again, sorry I didn't know this was a bad idea at the time.

So now I tried the "Sychronize Users to Contacts" function again.  When I did so it said:

Code: [Select]
Synchronize Users to Contacts completed. Checked 16 user records. Found 16 matching contact records. Created 0 new contact records.

Now none of our Drupal users can use CiviCRM.  CiviCRM thinks they are in the database but their rows were deleted and they cannot use CiviCRM.  The Sychronize function won't bring them back.  Is there some other record of their users that I must delete to get the Synchronize to work?  Do I have to delete a record of the Synchronize occuring to make it work?

THANKS for your help!  Please let me know.  I would like to avoid reinstalling the database completely, as I have imported a lot of data and made a lot of custom fields.


Try CiviTeacher: the online video tutorial CiviCRM learning library.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Importing Drupal users into CiviCRM
March 20, 2008, 12:50:55 am
Best way would be reinstall CiviCRM. 

Other option is truncate "civicrm_uf_match" table and then use "Sychronize Users to Contacts". (This might works, not sure).

kurund
Found this reply helpful? Support CiviCRM

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Importing Drupal users into CiviCRM
March 20, 2008, 10:15:52 am
Thank you for your help.  Truncating "civicrm_uf_match" seemed to do the trick.  It is a reference table between the Drupal and CiviCRM user tables evidently.

It has reset the Syncronize function.  Thanks!
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Importing Drupal users into CiviCRM

This forum was archived on 2017-11-26.