User Integration from bbPress to WordPress Guide.
-
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!
- First delete ‘wp_usermeta’ and ‘wp_users’ tables (having made that backup!)
- Change the name of ‘bb_usermeta’ to ‘wp_usermeta’ and ‘bb_users’ to ‘wp_users’.
- 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.
- The problem now is that none of these users have their WP roles defined.
- 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.
- 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).
- 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.
- 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.
- SQL: ‘select * from wp_usermeta where user_id not in (select ID from wp_users)’ will list all these non-existent users.
- It probably a good idea to do a full backup of your tables right now just in case.
- 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.
- 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.