Poll
Should the EE Team integrate the custom member data so that we can access it more easily?
Yes, as soon as possible 21
Yes, but it isn’t a priority 5
No, it wouldn’t help me 0
Total Votes: 26
You must be a logged-in member to vote
Help with Importing Member Data into Custom Member Fields
Posted: 12 May 2008 08:13 PM   [ Ignore ]  
Summer Student
Total Posts:  22
Joined  09-12-2007

I’m hoping someone can tell me how to get around a limitation of EE with importing member data, as I may have to change to a different system if I can’t get around this:
I am trying to import about 250 new members into our EE site. I can create an import file that will update the general predefined EE information; however, as I am sure you know, I can’t import any of the custom member data such as firstname, lastname, Etc. Please tell me there is a work around with this as it affects other sites I am also using EE on and I do not have the time to enter each person’s information into the site.
Please help.
Jeremy

Profile
 
 
Posted: 12 May 2008 11:30 PM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15489
Joined  05-15-2004

You can import all the data available in the exp_members table. It is true that there appears to be no easy way to do the same for custom member profile fields (which are stored in exp_member_fields and exp_member_data). Feel free to make the appropriate feature request.

Moderator’s note: Moved to General.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 13 May 2008 06:40 AM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  308
Joined  01-20-2006

You can import anything you want with the right SQL and custom php or php in templates using the database class.
I did my own very painful import of 12,000 users, and it’s all possible.

 Signature 

AJ Penninga
Pretty Squares, LLC - http://www.prettysquares.com

Profile
 
 
Posted: 10 July 2008 02:31 PM   [ Ignore ]   [ # 3 ]  
Grad Student
Avatar
Rank
Total Posts:  85
Joined  07-18-2007

I’m quite interested in seeing a procedure to do this, too. The member import feature is awesome, but I have a custom field I’d like to pull in, too. I’m basically a copy-paste PHP code monkey, so I’m afraid general instructions don’t do me much good, but if I can see an example of similar code, I can usually whack the SQL and PHP into what I need.

Profile
 
 
Posted: 10 July 2008 09:52 PM   [ Ignore ]   [ # 4 ]  
Summer Student
Total Posts:  22
Joined  09-12-2007

Unfortunately, the cost to get someone to help me develop a code is about $800, so I haven’t been able to aford getting the code developed. It would be nice if Expression Engine would help us with this by adjusted the import utility in some way.

Profile
 
 
Posted: 03 October 2008 02:28 PM   [ Ignore ]   [ # 5 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  231
Joined  07-09-2006

mmm, chips :-(. This was exactly what I was looking for. Importing fifty member with about 20 custom member fields per member ....

@AJP: can you help me a little bit with ‘right SQL’ and PHP. That would be great!

 Signature 

Erwin van Lun
Marketeer on a Mission

Profile
 
 
Posted: 04 October 2008 08:34 AM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  308
Joined  01-20-2006

EE has a great tool call the SQL manager, which allows you to view the database layout. Admin > Utilites > SQL Manger > Manage Database Tables.
There are 5 member tables.
exp_members is the where the standard member info is set up. Username, screen name etc. Find what fields you need. You must have a member group specified as well.

THis wiki article has the minimum info you need to import: http://expressionengine.com/wiki/Import_Members/

exp_member_data is where member custom profile fields are stored.
exp_member_fields has the field information, and exp_member_data is the actual record of those fields. You must match up m_field_id_## with the custom field name (and it’s ID number) as you import extra custom field data.

Then you must have a record in exp_member_homepage for each member.

THe member import tool will help you with default member stuff. This info should help you gather the required fields you need and required queries you need to build an import tool.

 Signature 

AJ Penninga
Pretty Squares, LLC - http://www.prettysquares.com

Profile
 
 
Posted: 04 October 2008 11:15 AM   [ Ignore ]   [ # 7 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  231
Joined  07-09-2006

Working on two threads now instantenously on this issue (other one is http://expressionengine.com/forums/viewthread/76223/). I now try to detail my approach:

1) import CSV with standard fields using the standard import member utility
2) export created memberId’s
3) update full CSV file with created member_id’s
4) convert my field ‘join_date’ into a Unix time stamp correlated to GMT time
5) start the EE SQL manager
6) use SQL LOAD DATA statement to create a temporary table with custom fields import the CSV
7) run several update queries on exp_member_data: UPDATE SET m.field_id_24 = temp.field_id_24 where m.member_id = temp.member_id
join_date - Unix time stamp correlated to GMT time
8) run update query on exp_member changing the join date
9) run insert sql statement for each new member on exp_member_homepage

The latter database table is totally new for me. Should I run a SQL statement like:

INSERT INTO exp_member_homepage (member_id, field_2, field_3 )
SELECT member_id
FROM temp_table

What do you think of this approach? Will it work? As I’m quite new in this constructions which might have a desastrous results, it’s my preference first to make a little plan.

Just a SQL question: should I specify all columns or will they be created as a default when I insert a row into exp_member_homepage?

 Signature 

Erwin van Lun
Marketeer on a Mission

Profile
 
 
   
 
 
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: 65087 Total Logged-in Users: 34
Total Topics: 82229 Total Anonymous Users: 22
Total Replies: 441928 Total Guests: 225
Total Posts: 524157    
Members ( View Memberlist )