Here's the setup:

  • The client uses a proprietary custom-coded PHP CMS and is wanting to move to WordPress with BuddyPress.

  • The old, custom CMS has a roster functionality, which I'm using BuddyPress custom fields to replace.

  • The custom fields are basic contact info (Phone, Fax) and company info (Text field).

What is the best way to import these? It seems my two options are:

  1. Create a pretty large SQL query that reformats this data between databases (I'm about 3 hours into doing it this way so far)

  2. Export it into some sort of JSON format and use the Ning importer.

If the best option is using the Ning importer, know where I can get an example Ning user list CSV so I may format the user data accordingly? If the best option is using a big MySQL query, what are some things I should look at in terms of row values WordPress expects?

Many thanks!

  • Also, if anybody knows of a better way to denote users as belonging to a company than simply a text field (And less involved than renaming the Groups functionality of BuddyPress), that'd be rad too. :) – aendrew Dec 6 '10 at 21:36
  • Are the buddypress custom fields within WP core? Or do they live in a separate table? – Ethan Seifert Dec 7 '10 at 0:24
  • They're BuddyPress xprofile fields, residing in wp_bp_xprofile_data – aendrew Dec 7 '10 at 3:40
  • I have created a plugin named BuddyPress Members Import youngtechleads.com/buddypress-members-import – ytl Mar 5 '13 at 20:33

I ended up writing a bunch of MySQL statements. My process went:

  1. Add users into wp_users.
  2. Add first name into wp_usermeta.
  3. Add last name into wp_usermeta.
  4. Add nickname into wp_usermeta.
  5. Add last activity into wp_usermeta. (This is important for BuddyPress; otherwise, users won't show up in the members-loop)
  6. Add name to BuddyPress.
  7. Add custom "phone" field to BP.
  8. Add custom "fax" field to BP.
  9. Add custom "company" field to BP.

If anybody doing something similar comes across this question and would like the SQL I used, feel free to message me. After half a dozen people requested the SQL code I have, I've written a blog post that includes the full SQL I used, plus a basic importer script. See: http://aendrew.com/content/importing-proprietary-user-database-buddypress-boss

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.