Importing member data
Posted: 18 September 2005 02:56 PM   [ Ignore ]  
Grad Student
Rank
Total Posts:  52
Joined  07-05-2004

it seems from a cursory search that it is possible to import member data.  I’d like to set up the initial members for a site this way so that I can assign them all to Member groups in batches..

Two questions:

What fields must I import and to which tables?

What to do about passwords during import (MD5 necessary?

Philip

Profile
 
 
Posted: 18 September 2005 07:04 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRankRank
Total Posts:  2541
Joined  12-21-2001

Where are you importing the member data from?

Here’s the minimal data you need:


group_id - the ID number for the member group this user belongs to
username
screen_name - can be identical to the username
password - can be MD5 or SHA1
unique_id - a random 32 character string, used for session cookies.
ip_address
join_date - Unix time stamp correlated to GMT time.
email


There are two additional tables that must contain a row for each member, correlated with the member_id of the member:

exp_member_data
exp_member_homepage

 Signature 
Profile
MSG
 
 
Posted: 18 September 2005 08:15 PM   [ Ignore ]   [ # 2 ]  
Grad Student
Rank
Total Posts:  52
Joined  07-05-2004

Brilliant - thanks fro the quick reply..

I’ll be importing from a text file (csv or tab).., likely have to use phpMyAdmin or Navicat..

If the password is entered as plain text will it break, or will the user be prompted to change it?

Profile
 
 
Posted: 18 September 2005 08:26 PM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32921
Joined  05-14-2004

Wiki’d

 Signature 
Profile
MSG
 
 
Posted: 18 September 2005 11:00 PM   [ Ignore ]   [ # 4 ]  
Administrator
Avatar
RankRankRankRankRank
Total Posts:  2541
Joined  12-21-2001

Users will not be prompted to change their password since that’s a bit of a security issue.  They can, however, click the “forgot password” link to have the password reset to something random and emailed to them. 

That said, MySQL supports MD5 conversion natively, so you could convert the passwords when you do the import.  The query would be something like:

INSERT INTO exp_members (password) values (MD5(‘some_password’))

 Signature 
Profile
MSG
 
 
Posted: 20 September 2005 05:10 PM   [ Ignore ]   [ # 5 ]  
Grad Student
Rank
Total Posts:  52
Joined  07-05-2004

Ok Thanks - Last question I hope..

Does an import trigger any of the member notification scripts?  For example will new members imported into the database recevie the welcome message by email if it is so configured?

Profile
 
 
Posted: 20 September 2005 06:14 PM   [ Ignore ]   [ # 6 ]  
Administrator
Avatar
RankRankRankRankRank
Total Posts:  2541
Joined  12-21-2001

Importing manually will not trigger any email sending routines, but using the “communicate” page you can send a mass welcome email to members of a particular group.

 Signature 
Profile
MSG
 
 
Posted: 20 September 2005 06:39 PM   [ Ignore ]   [ # 7 ]  
Grad Student
Rank
Total Posts:  52
Joined  07-05-2004

Hmm..  Tried an import and got a mySQL error - bad coding..

I cannot see the problem? -  unless I need to do the full insert but only populate the required fields?

INSERT INTO exp_members (group_id, username, screen_name, password, unique_id, email, ip_address, join_date) VALUES (‘5‘, ‘someone‘, ‘someone‘, MD5(‘id3613ng‘), ‘76530701ng86566272ri6092581835gn‘, ‘someuser@learnnet.nt.ca‘, ‘127.0.0.1‘, ‘1127274826‘);

Profile
 
 
Posted: 20 September 2005 07:32 PM   [ Ignore ]   [ # 8 ]  
Grad Student
Rank
Total Posts:  52
Joined  07-05-2004

Found the problem - the program I was using inserted quotes instead of apostrophes - my bad..

Worked like a charm once that was changed..

Thanks again..

Profile
 
 
Posted: 28 September 2005 06:36 AM   [ Ignore ]   [ # 9 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  486
Joined  07-12-2005

Argh, why couldn’t someone have put this info somewhere earlier???

Thank god, I can rest a touch easier. And thanks to all of you who answered! (or Rick at least) smile

 Signature 

Technology Consulting
Jobs, apartments, working and moving to Spain.

Profile
 
 
Posted: 29 September 2005 03:27 AM   [ Ignore ]   [ # 10 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  486
Joined  07-12-2005

Also, I want to ask about the password. I’ve tested importing members before and didn’t seem to need it. I was just going to send members to the forgotten password page initially and it resets the at that point anyway.  So I could leave the password blank then, no?

 Signature 

Technology Consulting
Jobs, apartments, working and moving to Spain.

Profile
 
 
Posted: 07 January 2006 09:10 PM   [ Ignore ]   [ # 11 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5891
Joined  11-23-2003
Rick Ellis - 18 September 2005 07:04 PM

Where are you importing the member data from?

Here’s the minimal data you need:


group_id - the ID number for the member group this user belongs to
username
screen_name - can be identical to the username
password - can be MD5 or SHA1
unique_id - a random 32 character string, used for session cookies.
ip_address
join_date - Unix time stamp correlated to GMT time.
email


There are two additional tables that must contain a row for each member, correlated with the member_id of the member:

exp_member_data
exp_member_homepage

Bringing this thread up again because I am doing some importing and I want to know why IP_Address is a minimum data component.  Does this really have to be filled if you are creating new members by manually inserting them into the database?  I assume this number changes with each visit in which there is a different IP address.  If this number is a definate requirement then I assume you can enter any IP address.  Just wondering because with such a big system you never know what something like this might affect.

 Signature 

EE 2.0:  A designers dream becomes a developers dream | Follow me on Twitter.

Profile
 
 
Posted: 07 January 2006 09:19 PM   [ Ignore ]   [ # 12 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32921
Joined  05-14-2004

See this wiki entry and the linked discussion about importing and IP addresses.

 Signature 
Profile
MSG
 
 
Posted: 07 January 2006 09:39 PM   [ Ignore ]   [ # 13 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5891
Joined  11-23-2003

Thanks sweetcheeks smile  that answers my question

 Signature 

EE 2.0:  A designers dream becomes a developers dream | Follow me on Twitter.

Profile
 
 
Posted: 07 January 2006 09:42 PM   [ Ignore ]   [ # 14 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32921
Joined  05-14-2004

I noted that you logged before posting that.  You better run.

*smiles*

 Signature 
Profile
MSG
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 65074 Total Logged-in Users: 27
Total Topics: 82207 Total Anonymous Users: 16
Total Replies: 441807 Total Guests: 176
Total Posts: 524014    
Members ( View Memberlist )
Newest Members:  mackskithbtggAdminempoleongwishPasha MahardikarmarkdurandomcatClutch BearingsAdil