My contribution, a script to convert phpbb users, forums, topics and posts to minibb. This script assumes your phpbb database name is PHPBB, your minibb table names are prefixed with minibb_* and the phpbb tables have phpbb_* prefix. Adjust where necessary. You will have to clear the minibb_users table if you run this script more than once.
# phpBB 2.0 to miniBB 2.0 Converter # Copyright (C) 2005 Monte Ohrt # # Purpose: # # The script will transfer categories, forums, users, and posts # from phpBB 2.0 to miniBB 2.0. # # Prerequisites: # # - phpBB 2.0 and miniBB 2.0 dbs are installed on the same server # - miniBB 2.0 is empty, fresh install # - phpBB 2.0 tables are prefixed with "phpbb_" # - miniBB 2.0 tables are prefixed with "minibb_" # # Directions: # # mysql minibb < phpbb2minibb.sql #
# Clear out minibb tables
TRUNCATE TABLE minibb_forums; TRUNCATE TABLE minibb_posts; TRUNCATE TABLE minibb_topics;
# No categories in miniBB, skip.
# # Copy forums. #
INSERT INTO minibb_forums (forum_id, forum_name, forum_desc, forum_order, forum_icon, topics_count, posts_count) SELECT forum_id, forum_name, forum_desc, forum_order, 'default.gif', forum_topics, forum_posts FROM PHPBB.phpbb_forums;
# # Copy users. #
INSERT INTO minibb_users (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interest, user_viewemail, user_sorttopics, user_newpwdkey, user_newpasswd, language, activity) SELECT user_id, username, FROM_UNIXTIME(user_regdate), user_password, user_email, user_icq, user_website, user_occ, '', user_interests, user_viewemail, 1, '', '', user_lang, 1 FROM PHPBB.phpbb_users;
# No security access in minibb, skip.
# # Copy topics. #
INSERT INTO minibb_topics (topic_id, topic_title, topic_poster, topic_poster_name, topic_time, topic_views, forum_id, topic_status, topic_last_post_id, posts_count, sticky) SELECT DISTINCT topic_id, topic_title, topic_poster, '', FROM_UNIXTIME(topic_time), topic_views, forum_id, topic_status, topic_last_post_id,0,0 FROM PHPBB.phpbb_topics;
# get poster name update minibb_topics, minibb_users set minibb_topics.topic_poster_name = minibb_users.username where minibb_topics.topic_poster = minibb_users.user_id;
# calculate post count for each topic
create table tmp_post_count (topic_id int, post_count int); insert into tmp_post_count select p.topic_id, count(p.post_id) from PHPBB.phpbb_posts p group by p.topic_id;
update minibb_topics, tmp_post_count set minibb_topics.posts_count = tmp_post_count.post_count where minibb_topics.topic_id = tmp_post_count.topic_id;
drop table tmp_post_count;
# Copy posts.
INSERT INTO minibb_posts (post_id, forum_id, topic_id, poster_id, poster_name, post_text, post_time, poster_ip, post_status) SELECT DISTINCT p.post_id, p.forum_id, p.topic_id, p.poster_id, '', '', FROM_UNIXTIME(p.post_time), poster_ip, 0 FROM PHPBB.phpbb_posts p;
# get poster name update minibb_posts, minibb_users set minibb_posts.poster_name = minibb_users.username where minibb_posts.poster_id = minibb_users.user_id;
# Copy post text.
update minibb_posts, PHPBB.phpbb_posts_text set minibb_posts.post_text = PHPBB.phpbb_posts_text.post_text where minibb_posts.post_id = PHPBB.phpbb_post_text.post_id; |