ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Help with Importing Member Data into Custom Member Fields

May 12, 2008 11:13pm

Subscribe [8]
  • #1 / May 12, 2008 11:13pm

    jeremygrandstaff

    15 posts

    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

  • #2 / May 13, 2008 2:30am

    Ingmar

    29245 posts

    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.

  • #3 / May 13, 2008 9:40am

    AJP

    311 posts

    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.

  • #4 / Jul 10, 2008 5:31pm

    Opaline

    71 posts

    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.

  • #5 / Jul 11, 2008 12:52am

    jeremygrandstaff

    15 posts

    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.

  • #6 / Oct 03, 2008 5:28pm

    ErwinVanLun

    235 posts

    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!

  • #7 / Oct 04, 2008 11:34am

    AJP

    311 posts

    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.

  • #8 / Oct 04, 2008 2:15pm

    ErwinVanLun

    235 posts

    Working on two threads now instantenously on this issue (other one is http://ellislab.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?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases