The following sql scripts are based on wishcraft's post
here. It worked for me, and I hope to work for you too.
TRUNCATE xoops_xf_archive;
TRUNCATE xoops_xf_attachments;
TRUNCATE xoops_xf_categories;
TRUNCATE xoops_xf_digest;
TRUNCATE xoops_xf_extras;
TRUNCATE xoops_xf_field;
TRUNCATE xoops_xf_forums;
TRUNCATE xoops_xf_moderates;
TRUNCATE xoops_xf_online;
TRUNCATE xoops_xf_posts;
TRUNCATE xoops_xf_posts_text;
TRUNCATE xoops_xf_reads_forum;
TRUNCATE xoops_xf_reads_topic;
TRUNCATE xoops_xf_report;
TRUNCATE xoops_xf_topics;
TRUNCATE xoops_xf_visibility;
TRUNCATE xoops_xf_votedata;
INSERT INTO xoops_xf_archive SELECT * FROM xoops_bb_archive;
INSERT INTO xoops_xf_attachments SELECT * FROM xoops_bb_attachments;
INSERT INTO xoops_xf_categories(cat_id, cat_image, cat_title, cat_description, cat_order, cat_url) SELECT * FROM xoops_bb_categories;
INSERT INTO xoops_xf_digest SELECT * FROM xoops_bb_digest;
INSERT INTO xoops_xf_moderates SELECT * FROM xoops_bb_moderates;
INSERT INTO xoops_xf_online SELECT * FROM xoops_bb_online;
INSERT INTO xoops_xf_posts (post_id, pid, topic_id, forum_id, post_time, uid, poster_name, poster_ip, `subject`, dohtml, dosmiley, doxcode, dobr, doimage, icon, attachsig,approved,post_karma,attachment,require_reply) SELECT * FROM xoops_bb_posts;
INSERT INTO xoops_xf_posts_text SELECT * FROM xoops_bb_posts_text;
INSERT INTO xoops_xf_reads_forum SELECT * FROM xoops_bb_reads_forum;
INSERT INTO xoops_xf_reads_topic SELECT * FROM xoops_bb_reads_topic;
INSERT INTO xoops_xf_report SELECT * FROM xoops_bb_report;
INSERT INTO xoops_xf_topics SELECT * FROM xoops_bb_topics;
INSERT INTO xoops_xf_votedata SELECT * FROM xoops_bb_votedata;
INSERT INTO xoops_xf_forums (forum_id, forum_name, forum_desc, parent_forum, forum_moderator, forum_topics, forum_posts, forum_last_post_id, cat_id, forum_type, allow_html, allow_sig, allow_subject_prefix, hot_threshold, forum_order, attach_maxkb, attach_ext, allow_polls) SELECT * FROM xoops_bb_forums;