Skip to:

User Integration from bbPress to WordPress Guide.

  • deadlyhifi


    All integration guides appear to have the userbase in WP. I was in the situation where my userbase was in bbPress, so I needed to get all my bb_users into wp_users.

    The following refers to WP2.7 and bbPress 1.06a.

    The process is actually quite straight forward but do make backups of your database beforehand!

    1. First delete ‘wp_usermeta’ and ‘wp_users’ tables (having made that backup!)
    2. Change the name of ‘bb_usermeta’ to ‘wp_usermeta’ and ‘bb_users’ to ‘wp_users’.
    3. The tables structures from bbP are the same as WP apart from one field in the ‘_users’ table. So we need to add FIELD: user_activation_key TYPE: varchar(60) NULL: NO after the ‘user_registered’ field.
    4. The problem now is that none of these users have their WP roles defined.
    5. To do this we need to insert the ‘meta_key’ and ‘meta_value’ to ‘wp_capabilities’ and ‘a:1:{s:10:”subscriber”;b:1;}’ for each user.
    6. wordpress_capabilites.sql contains an SQL insert statement for 5000 users. If your userbase is less than that you only need to run it for your number of users (although we deal with overruns in a minute).
    7. Once this has run each user will have ‘subscriber’ status within wordpress. You need to manually change your bbPress key holder (most likely user_id 1) ‘wp_capabilities’ to ‘a:1:{s:13:”administrator”;b:1;}’. This gives that account administrator status within WP.
    8. It’s highly likely that you’ll have deleted some users in the past, or run too many INSERTs from the wordpress_cabalilities file, so we need to delete all those ‘wp_capabilities’ that aren’t mapped to an exisiting user.
    9. SQL: ‘select * from wp_usermeta where user_id not in (select ID from wp_users)’ will list all these non-existent users.
    10. It probably a good idea to do a full backup of your tables right now just in case.
    11. Now run this SQL: ”delete from wp_usermeta where user_id not in (select ID from wp_users)” – this will delete all those stray entries.
    12. Done.

    All worked out with the help of someone I work with, so I can’t take all the credit ;)

    Good luck.

  • You must be logged in to reply to this topic.
Skip to toolbar