Hi all I have data for several persons in an excel file and i would like to convert all of these people in users in my drupal 6. Somebody knows how can i do this? The idea is that not to have to create the users one by one, maybe i would have to make an sql script to include the users in one time, but i don't know in which tables I have to include the data and some other things for example, how have i to set the password? (this is encrypted in the database field) thanks in advance Gastón Pablo Perez Email: gpperez@gmail.com Web: http://cv.gpperez.com.ar
Gaston, user_import module Regards, Ashley Maher (didymo) Gastón Pablo Pérez wrote:
Hi all
I have data for several persons in an excel file and i would like to convert all of these people in users in my drupal 6. Somebody knows how can i do this? The idea is that not to have to create the users one by one, maybe i would have to make an sql script to include the users in one time, but i don't know in which tables I have to include the data and some other things for example, how have i to set the password? (this is encrypted in the database field)
thanks in advance
Gastón Pablo Perez Email: gpperez@gmail.com <mailto:gpperez@gmail.com> Web: http://cv.gpperez.com.ar
Gastón, You can do this programmatically by creating a separate script that bootstraps Drupal. Something like: if (($handle = fopen("file.csv", "r")) !== FALSE) { while (($data = fgetcsv($handle)) !== FALSE) { // Set vars to the appropriate indexes from the .csv, you'll need to customize this list($user, $pass, $mail) = $data; // Create the user array $new_user = array( 'name' => $user, 'pass' => $pass, 'mail' => $mail, 'status' => 1, 'init' => $mail, ); if(!user_load($new_user)) { // Make sure the user doesn't already exist // If you want to assign a role $roles = user_roles(); $new_user['roles'] = array(array_search('your_roll_name', $roles) => 1); // Save the user $new_user = user_save(null, $new_user); } } fclose($handle); } On Dec 2, 2009, at 5:38 PM, Gastón Pablo Pérez wrote:
Hi all
I have data for several persons in an excel file and i would like to convert all of these people in users in my drupal 6. Somebody knows how can i do this? The idea is that not to have to create the users one by one, maybe i would have to make an sql script to include the users in one time, but i don't know in which tables I have to include the data and some other things for example, how have i to set the password? (this is encrypted in the database field)
-- Matt West Software Developer Our Hometown, Inc mjw@our-hometown.com
The only check you want to watch out for is if the email already exists (you don't want two users with the same email, that's a check Drupal does when you create a new user interactively). Forage for the code in the user.module. Victor Kane http://awebfactory.com.ar On Wed, Dec 2, 2009 at 8:08 PM, Matt West <mjw@our-hometown.com> wrote:
Gastón,
You can do this programmatically by creating a separate script that bootstraps Drupal. Something like:
if (($handle = fopen("file.csv", "r")) !== FALSE) { while (($data = fgetcsv($handle)) !== FALSE) { // Set vars to the appropriate indexes from the .csv, you'll need to customize this list($user, $pass, $mail) = $data;
// Create the user array $new_user = array( 'name' => $user, 'pass' => $pass, 'mail' => $mail, 'status' => 1, 'init' => $mail, );
if(!user_load($new_user)) { // Make sure the user doesn't already exist // If you want to assign a role $roles = user_roles(); $new_user['roles'] = array(array_search('your_roll_name', $roles) => 1);
// Save the user $new_user = user_save(null, $new_user); } } fclose($handle);
}
On Dec 2, 2009, at 5:38 PM, Gastón Pablo Pérez wrote:
Hi all
I have data for several persons in an excel file and i would like to convert all of these people in users in my drupal 6. Somebody knows how can i do this? The idea is that not to have to create the users one by one, maybe i would have to make an sql script to include the users in one time, but i don't know in which tables I have to include the data and some other things for example, how have i to set the password? (this is encrypted in the database field)
-- Matt West Software Developer Our Hometown, Inc mjw@our-hometown.com
Gastón Pablo Pérez wrote:
I have data for several persons in an excel file and i would like to convert all of these people in users in my drupal 6. Somebody knows how can i do this? The idea is that not to have to create the users one by one, maybe i would have to make an sql script to include the users in one time, but i don't know in which tables I have to include the data and some other things for example, how have i to set the password? (this is encrypted in the database field) Hi. I have code I used to create users from osCommerce users in a CSV file. The 'from' columns will be different, but you if it will be useful at all e-mail me and I'll send it to you. The password is simply md5($the-original-password).
Jeff
On Dec 2, 2009, at 5:38 PM, Gastón Pablo Pérez wrote:
Hi all
I have data for several persons in an excel file and i would like to convert all of these people in users in my drupal 6. Somebody knows how can i do this? The idea is that not to have to create the users one by one, maybe i would have to make an sql script to include the users in one time, but i don't know in which tables I have to include the data and some other things for example, how have i to set the password? (this is encrypted in the database field)
Check out http://drupal.org/project/feeds It contains an import option for users from CSV. If the standard CSV field to user property mapping doesn't meet your needs, you can adjust it on admin/build/feeds/edit/user/mapping Alex
thanks in advance
Gastón Pablo Perez Email: gpperez@gmail.com Web: http://cv.gpperez.com.ar
Alex Barth http://www.developmentseed.org/blog tel (202) 250-3633
There's also the userimport module which I've used successfully with zero problems a number of times. http://drupal.org/project/user_import --Kyle Mathews kyle.mathews2000.com/blog http://twitter.com/kylemathews On Wed, Dec 2, 2009 at 5:27 PM, Alex Barth <alex@developmentseed.org> wrote:
On Dec 2, 2009, at 5:38 PM, Gastón Pablo Pérez wrote:
Hi all
I have data for several persons in an excel file and i would like to convert all of these people in users in my drupal 6. Somebody knows how can i do this? The idea is that not to have to create the users one by one, maybe i would have to make an sql script to include the users in one time, but i don't know in which tables I have to include the data and some other things for example, how have i to set the password? (this is encrypted in the database field)
Check out http://drupal.org/project/feeds
It contains an import option for users from CSV.
If the standard CSV field to user property mapping doesn't meet your needs, you can adjust it on
admin/build/feeds/edit/user/mapping
Alex
thanks in advance
Gastón Pablo Perez Email: gpperez@gmail.com Web: http://cv.gpperez.com.ar
Alex Barth http://www.developmentseed.org/blog tel (202) 250-3633
Hi Gastón, El Wed, 2 Dec 2009 19:38:45 -0300 Gastón escribió:
Hi all
I have data for several persons in an excel file and i would like to convert all of these people in users in my drupal 6. Somebody knows how can i do this? The idea is that not to have to create the users one by one, maybe i would have to make an sql script to include the users in one time, but i don't know in which tables I have to include the data and some other things for example, how have i to set the password? (this is encrypted in the database field)
Maybe you want to take a look to: http://groups.drupal.org/node/21338
thanks in advance
Gastón Pablo Perez Email: gpperez@gmail.com Web: http://cv.gpperez.com.ar
Regards, ___________________________ Marco Antonio Villegas Vega ( º - º ) Ing. Informatica http://marvil07.net
Hi, yet another option is the excellent module pair - Migrate and Table Wizard http://drupal.org/project/migrate http://drupal.org/project/tw Many thanks, John Oakley On 03/12/2009, at 8:08 AM, Gastón Pablo Pérez wrote:
Hi all
I have data for several persons in an excel file and i would like to convert all of these people in users in my drupal 6. Somebody knows how can i do this? The idea is that not to have to create the users one by one, maybe i would have to make an sql script to include the users in one time, but i don't know in which tables I have to include the data and some other things for example, how have i to set the password? (this is encrypted in the database field)
thanks in advance
Gastón Pablo Perez Email: gpperez@gmail.com Web: http://cv.gpperez.com.ar
Hi all Thanks! thanks! thanks! for all... I probed module user_import and user_import_og (for include the users directly on the groups).. they're fantastic. thanks newly Gastón Pablo Perez Email: gpperez@gmail.com Web: http://cv.gpperez.com.ar On Wed, Dec 2, 2009 at 11:54 PM, John Oakley <john.oakley@batchelor.edu.au>wrote:
Hi,
yet another option is the excellent module pair - Migrate and Table Wizard
http://drupal.org/project/migrate
Many thanks,
John Oakley
On 03/12/2009, at 8:08 AM, Gastón Pablo Pérez wrote:
Hi all
I have data for several persons in an excel file and i would like to convert all of these people in users in my drupal 6. Somebody knows how can i do this? The idea is that not to have to create the users one by one, maybe i would have to make an sql script to include the users in one time, but i don't know in which tables I have to include the data and some other things for example, how have i to set the password? (this is encrypted in the database field)
thanks in advance
Gastón Pablo Perez Email: gpperez@gmail.com Web: http://cv.gpperez.com.ar
participants (9)
-
Alex Barth -
Ashley Maher -
Gastón Pablo Pérez -
Jeff Greenberg -
John Oakley -
Kyle Mathews -
Marco Antonio Villegas Vega -
Matt West -
Victor Kane