User Import for BuddyPress (All Fields)

With this plugin now you can import users with all xprofile fields to your BuddyPress installation.

This plugin will automatically activate all user accounts and send notification as selected by the admin at the time of import.

It currently works with WordPressMU + BuddyPress installation.
Download (Version 1.0)
 

Data formatting instructions

Formatting Data is the vital while to ensure error free import of records into Buddy Press.
For your reference, follow the examples below for each field and type.
 

Check number of Delimiter

1. Count the Number of Fields in your Buddypress xprofile installation. The screenshot provides the explanation

In the example, these are the fields.

  1. Full Name

  2. About

  3. Gender
  4. Interests
  5. Favorite Food

  6. Date of Birth

  7. Country

Thus

Fields – 7

Delimiter – Fields + 1 = 8. The | is the delimiter.

So our data string should be like :
username|email@dmainname.com|||||||
i.e. username + | + email@domainname.com + 7 Delimiters
 

Text Box Type

2. Let us now take our first field Full Name whose Field Type is textbox (Shown in 1 Image)
For textbox field type you can enter any string like : Andy, Manoj Kumar or YourName etc.
I am taking field value as “Manoj Kumar” for full name

So our data string now should be like :
username|email@dmainname.com|Manoj Kumar||||||
i.e. username + | + email@domainname.com + | + Full Name + 6 Delimiters
 

Textarea Type

3. Second Filed in my installation is of textarea type by name About
Let us assume that field value for About is “This is the field value for About field whose Field Type is textarea”

So our data string now should be like :
username|email@dmainname.com|Manoj Kumar|This is the field value for About field whose Field Type is textarea|||||
i.e. username + | + email@domainname.com + | + Full Name Value + | + About Value + 5 Delimiters
 

Radio Type

4. Our next field is Gender which is of radio type. By nature radio type field can take only one value form given options.

I have following options in my installation
Option 1 – Male

Option 2 – Female

Lets say I want to select Male value for Gender field

Note: All Field Types except textbox and textarea are case sensitive. i.e. If you enter value “male” instead of “Male” it will not work.

So now data string should be like :
username|email@dmainname.com|Manoj Kumar|This is the field value for About field whose Field Type is textarea|Male||||
i.e. username + | + email@domainname.com + | + Full Name Value + | + About Value + | + Gender + 4 Delimiters
 

Multi Select Box Type

5. Next field is multiselectbox by name Interests. Multiselect box can take one or more values, so we are delimiting values more then one by (Tilde Sign [~] ).

I have following options in my installation for Interests
Option 1 – Movies

Option 2 – Traveling

Option 3 – Driving

Option 4 – Dancing

Lets say I want to select Movies as well as Dancing value for Interests field, my data string for this field should be “Movies~Dancing”

Note: All Field Types except textbox and textarea are case sensitive. i.e. If you enter value “movies” or “mOvies” instead of “Movies” it will not work.

So now data string should be like :
username|email@dmainname.com|Manoj Kumar|This is the field value for About field whose Field Type is textarea|Male|Movies~Dancing|||
i.e. username + | + email@domainname.com + | + Full Name Value + | + About Value + | + Gender + | + Interests + 3 Delimiters
 

Check Box Type

6. Next field is Favorite Food which is of checkbox type. Data formatting for Check Box Field types are same as Multi Select Box. i.e. Delimiting more then one values by (Tilde Sign [~] )

I have following options in my installation for Favorite Food
Option 1 – Pizza

Option 2 – Hot dogs

Option 3 – Sweet potato

Option 4 – Pasta

Lets say I want to select Pizza and Hot dogs value for Favorite Food field, my data string for this field should be “Pizza~Hot dogs”

Note: All Field Types except textbox and textarea are case sensitive. i.e. If you enter value “Hot Dogs” or “hot dogs” instead of “Hot dogs” it will not work.

So now data string should be like :
username|email@dmainname.com|Manoj Kumar|This is the field value for About field whose Field Type is textarea|Male|Movies~Dancing|Pizza~Hot dogs||
i.e. username + | + email@domainname.com + | + Full Name Value + | + About Value + | + Gender + | + Interests + | + Favorite Food value + 2 Delimiters
 

Date Box Type

7. My next field is Date of Birth of datebox type. Its really simple to format datebox type field simply enter date in as “1 January 2009″. i.e. Date in numer + Space + Month (Like January, February, March etc) + Space + Year in numbers (like 1995, 2001, 2005 etc)

I am taking “1 January 2009″ as Date of Birth – This is an example

So now data string should be like :
username|email@dmainname.com|Manoj Kumar|This is the field value for About field whose Field Type is textarea|Male|Movies~Dancing|Pizza~Hot dogs|1 January 2009|
i.e. username + | + email@domainname.com + | + Full Name Value + | + About Value + | + Gender + | + Interests + | + Favorite Food value + | + Date Value + 1 Delimiter
 

Select Box Type

8. Last field in my installation is country which is of selectbox type. Formatting for Select Box Type is same as textbox and textarea type, Difference is just selectbox is case sensitive.

Note: All Field Types except textbox and textarea are case sensitive. i.e. If you enter value “india” or “INDIA” instead of “India” it will not work.

I am taking “India” as value for this field

So now data string should be like :
username|email@dmainname.com|Manoj Kumar|This is the field value for About field whose Field Type is textarea|Male|Movies~Dancing|Pizza~Hot dogs|1 January 2009|India
i.e. username + | + email@domainname.com + | + Full Name Value + | + About Value + | + Gender + | + Interests + | + Favorite Food Value + | + Date Value + | + Country Value
 

Blank or field with no value

9. If you do not have value for any specific field you can leave it as blank for example if we don’t have interests field value for a particular record our data string will look like
username|email@dmainname.com|Manoj Kumar|This is the field value for About field whose Field Type is textarea|Male||Pizza~Hot dogs|1 January 2009|India

All suggestions are welcome.

58 thoughts on “User Import for BuddyPress (All Fields)

  1. The Big K says:

    Hi Manoj,

    How does this work when the fields are distributed among various groups? For example, I have ‘Base’, “Personal Information”, “Contact” etc.

    How to format data in this case?

  2. @The Big K

    Data formatting will be the same even if you have one or more groups…

    Just keep the sequence same as example shown in above the box in your installation…

  3. The Big K says:

    Hi Manoj,

    Thank you for quick reply. So as I understand if I have -

    Base: (Group)
    Full Name
    Contact Number

    Profession: (Group)
    Company:
    Designation

    I treat the fields as -
    Full Name
    Contact Number
    Company
    Designation

    While ignoring the groups. I just need to keep the order of the fields correct. Am I right?

  4. @ The Big K

    Yes, you are right. But please refer to the sequence given on my plugin page like : Full Name|Contact Number| etc…..

    test on sample data first

  5. The Big K says:

    Hi Manoj, there’s is a big problem. After successful import, I do not see the profile fields being reflected in the user profiles. In the test run I did, only the last field I have “Marital Status” is being displayed in user profile.

    Am I doing anything wrong?

  6. The Big K says:

    Hi I think following might help you decide if there’s a bug. I select third mailing option “activate and do not send mail”.

    However, when I check the database, the newly imported user appears under table “wp_signups” and not under “wp_user”. Looks like the activation part is not working.

  7. @The Big K

    You might be right.

    Since I am not creating any activation function of my own but using WordPress MU activation which automatically triggers BuddyPress function. So we need to debug BuddyPress functions…

    In my installation everything is working fine expect its not adding Full Name to user profile.

    I have tested it on RC1 for about 60, 70 records and working on it for completely error free import…

    All suggestions are welcome, You can try first option for the time being.

  8. The Big K says:

    I guess I found the exact thing. The setup expects that you create profile fields and then do a clean import. If you delete and then add profiles, the plugin only imports the data that has associated correct field ID to it. Do have a look into this. I created all the profiles from scratch and tried importing the data – it worked like magic!

    By the way, is there any limit on how many records we can import in one go ?

  9. @the big k

    Thanks for testing.

    I will check

    I don’t think there is any limit to data import. Limit is related to your server only. i. e. How much data it can Handel without timeout or any other limitation.

  10. The Big K says:

    @Manoj: The new theme looks perfect

    The import script worked very well and I could import about 1500 users with it. But I took a pause for 2 days in which users created blogs, groups, and updated their profile.

    Now when I try to import the users, it only imports just one or two fields and discards the others. I do get import successful message at the end of import.

    PS: This is for BP RC1 & WPMU 2.7 version.

  11. @The Big K

    Check for values in your wp_signups and wp_users table.

    Also all data is case sensitive, if there are any mismatch in case, it will not display it in profile.

  12. The Big K says:

    Hi Manoj,

    I checked the profiles. For the users who were imported successfully but not with all their profile data; following are my findings:

    They appear in :

    wp_signups
    wp_usermeta
    wp_users

    Interesting Observation: Instead of the profile data getting populated in the appropriate xprofile_fields_data table, the data gets dumped into wp_user_signups table in field titled “meta” in the following format:

    a:49:{s:7:”field_1″;s:14:”Rohan Gupta”;s:7:”field_2″;s:0:””;s:7:”field_7″;s:11:”Music”;s:8:”field_22″;s:0:””;s:8:”field_50″;s:0:””;

    Could you please fix this? I’ll be grateful to you forever.

  13. The Big K says:

    PS: I did check case sensitivity for the fields with multiple options and for the username/email fields. Everything is fine there. The import worked very well for first 1500+ data.

  14. The Big K says:

    @Manoj: It’s still the RC1 on WPMU 2.7. Not on the latest version.

    If you could make this work on the RC2, I guess my problem will be solved.

  15. The Big K says:

    Crappy me! It’s the ‘meta’ field in “wp_signups” table. Sorry for the wrong information.

  16. The Big K says:

    My last two comments got lost?

    My mistake. It’s n not the wp_user_signups table. It’s the ‘meta’ field in ‘wp_signups’ table that gets the in the format posted above.

    PS: This is on BP RC1, WPMU 2.7.

  17. The Big K says:

    Waiting for a fix . By the way, the plugin works very well on RC2. I just copied it in the ‘buddypress’ folder and it works very well. However, the same problem repeats.

    I don’t know what exactly is going wrong. Now it only 2-3 fields correctly and discards all others (even though the data is valid). I think when users make changes to their profile, the internal organization of field IDs/ and corresponding data fields changes…that’s why the script does not import the data correctly.

    Waiting for a response…

  18. First – thanks for developing this. If I can get it working, it’ll save me loads of time and probably at least one long, fruitless meeting. 
I’m running WPMU 2.7.1 and the shiny new BP 1.0, and this is what I get when I try to activate this plugin:

    Plugin could not be activated because it triggered a fatal error.

    Warning: require_once(bp-core.php) [function.require-once]: failed to open stream: No such file or directory in /home/asmacnet/asmacnet.org/wp-content/plugins/user-import-for-buddypress-all-fields/bp-user-import-adv.php on line 29

    Fatal error: require_once() [function.require]: Failed opening required ‘bp-core.php’ (include_path=’.:/usr/local/php5/lib/php:/usr/local/lib/php’) in /home/asmacnet/asmacnet.org/wp-content/plugins/user-import-for-buddypress-all-fields/bp-user-import-adv.php on line 29

    ..so the location of the core has changed since RC2, I guess? I’ve looked at the code, but I’m too much of a newbie to know what/how to fix it. Thanks for your time and work on this!

  19. Import works great but the email is not being received/sent. Any recommendations? Email normally works fine with all other plugins/applications.

  20. @Ray,

    Difference between these plugins is that one is designed for importing all fields data, and another import only default fields

    I will fix it for BP 1.0.1 soon

  21. Fawad ITM says:

    I know it’s off the topic but does anyone know if there are any privacy plugins or setting options available in BuddyPress?

    I am setting up an instance where users only would like to share certain information (like Birthday and other stuff) with their friends not with everyone else.

    Please advise.
    Thank you
Fawad

  22. Is the plugin compatible with the latest buddypress, I have not installed either yet, wondering before I screw something up

  23. The Big K says:

    Hi Manoj,

    The plugin is not compatible with WPMU 2.8.3 & Buddypress 1.0.3. Could you please fix it.

  24. rushi says:

    i can second it not working for 2.8.3 and buddypress 1.0.3
    The error was on line 29 could not find file, weird

    Warning: require_once(bp-core.php) [function.require-once]: failed to open stream: No such file or directory in
/wp-content/mu-plugins/bp-user-import-adv.php on line 29

  25. Mans says:

    Hi Manoj! This is exactly what I want. I have been merging 2 MPWU sites, one with BP on it. When will/can you release an update that works with latest WPMU and BP versions?

  26. Patrick says:

    hello manoj, i’d like to use your buddypress plugin for user import (all fields). i currently have installed wordpress 2.8.1 and buddypress 1.0.2. i tried downloading it but it does not work. is it because it is not RC1? please help me. thanks in advance!

  27. Patrick says:

    Hello Manoj, thanks i ave successfully installed the plugin. Right now, I cannot upload to the fields properly. I followed the format but I only successfully created the username and email. The fields dont get imported. Also the verfication email is not given out. Please advise on what to do or check. Should there be additional setup, i missed doing like pemissions on the database?

  28. Patrick says:

    This is what i currently have now. I’m still in the process of creating the website. I hope you can help me make this work.

    BASE
    Name textbox
    Nickname textbox
    SCHOOL DETAILS (Field Group)
    University selectbox

  29. Patrick says:

    Oh sorry, Manoj. Basically, I followed the format that you placed in the plugin. username|email@dmainname.com|Name|Nickname|University. The university currently has 3 choices. ADMU, DLSU or UST. I tried the types of notification already but all they did was successfully create the user but not the xprofile data. I’m wondering why the ‘create user’ gets through, but the xprofile details dont. What did I do wrong. My WPMU is 2.8.4 while my BP is 1.1. I installed the latest version of this plugin. Just let me know if you need other info. Thanks Manoj.

  30. couple of questions
    1) What is the password to login for an imported user ? should user request a ‘forgot password’ to login ?
    2) when imported only one record getting imported ? how to import multiple records ? do we need a different delimiter for multiple records ? I tried new record in a separate line.
I am on BP1.1.1 and WP2.8.4a

  31. ora says:

    Just an update
    1) able to import multiple users in another BP installation, so assuming some problem in my old BP installation.
    As Patrick mentioned it did imported users but didn’t create any data in bp_xprofile_data table, so profile fields are not displaying.
    2) Still want to know how to set default password for imported users without using ‘forgot password’ functionality.

  32. @ora : Currently it doesn’t support password import. With regard to retrieving password without using “Forgot Password” option. This plugin has an option where it mail the password to the user you’re importing.

Comments are closed.