简体   繁体   中英

Create Drupal User for each CiviCRM Contact

I've been having such a rough time trying to figure this out. I've found a few sources that hint about getting this done, but nothing has explicitly say HOW to make it happen. Hopefully someone here can help.

I've got Drupal 7 running with CiviCRM 4.4, with contacts already imported. That part is good, I've got that completely understood.

What I'm trying to do is create a new Drupal User Account for each of the CiviCRM contacts. One path I went down was to install the Feeds and Feeds Import modules to import users via a CSV file. From there, I went to CiviCRM, exported a user list as CSV, and tried importing it via the Feeds Import module ----- Nope, didn't work. Apparently the format was not correct. I would be fine going through and editing each record, if not for my having 900+ Contacts that need accounts.

There must be a better way, as I'm sure this is something that surely has to have been done many times over by other users. Can anyone offer me any assistance on how to create a Drupal User Account for each of my CiviCRM contacts?

Apparently the fine folks at CiviCRM have already solved this problem. Here's a link for anyone who runs into the same fix I found myself in: https://civicrm.org/blog/petednz/creating-drupal-users-made-easy-for-single-or-multiple-contacts-via-civi-imports-and

user161592 seems to have the best answer if you are using Drupal 7. The technique at https://civicrm.org/blog/petednz/creating-drupal-users-made-easy-for-single-or-multiple-contacts-via-civi-imports-and requires the civicrm_entity module, which only works for Drupal 7.

For Drupal 6, you can use the user import module: https://www.drupal.org/project/user_import

This requires you to search the civicrm DB for the users for whom to create an account, export the users (choosing the field list for the fields you will need in the Drupal account creation), then flip the Drupal side and import the resulting .csv file with the user import module.

So it requires some admin intervention each time you want to do it, but it does work quite well and does not take long to do once it is all set up (you can save the field set in CiviCRM and the import set up in the user import module - so repeating the same type of import is pretty easy).

I had to add the following to the import script to import properly:

"username_format" : "first.middle.last"

Paste this just below the signin definition.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM