Reply To: bbPress Upgrade shows I am author of all topics and replies
Hi Kannued,
There were 2 queries I posted. There needs to be 2 because previously in v1 bbPress had 2 seperate tables – one table for the initial topic post and then another table for the followup replies. All posts are now contained in wp_posts.
So the first query takes all the author ids from the forum topics and copies them across to the wp_posts table:
update wp_posts inner join bb_topics on wp_posts.post_title=bb_topics.topic_title set wp_posts.post_author = bb_topics.topic_poster
The second then does all the replies:
update wp_posts inner join bb_posts on bb_posts.post_time = wp_posts.post_date set wp_posts.post_author = bb_posts.poster_ id where wp_posts.post_author = ’1′
(This is a bit messier. The only way I found to match bb_posts to wp_posts was by the time the post was made. For some reason looking at the text of the actual post didn’t match. Perhaps there was an encoding difference or something.)
Before running either it might be a good idea to check you are getting the same error I have. If you run the following:
select topic_title,topic_poster,post_author from wp_posts inner join bb_topics on wp_posts.post_title=bb_topics.topic_title order by bb_topics.topic_id desc
This doesn’t make any changes. It shows you 3 columns: topic title / author in old bbpress / author in new bbpress.
For me the 3rd column was all 1s (which is my user id). So all I had to do was copy the second column across, which is what the 2 queries above do.