My first hurdle was the quality of responses on the internet, for some reason people couldn't understand the need to migrate data from a forum to a blog stating that these were very different systems.
You might want to rethink if you cant;
- understand the need
- forum labels and blog tags
- forum topics and blog posts
- forum replies and blog comments
I see a service out there that makes you request a quote and apparently they base their price on the size of your data? say what?
Anyway, below is a quick and dirty sql script to go from phpbb2 to wordpress, use at your own risk
steps;
- get a working environment with mysql (I installed WAMPstack)
- import your phpbb db
- install wordpress
- edit and run the following on your mysql db
begin;
insert into wp_users (
id,
user_login,
user_pass,
user_nicename,
user_email,
user_url,
user_registered,
user_activation_key,
user_status,
display_name
)
select
user_id,
username,
user_password,
username,
user_email,
user_website,
from_unixtime(user_regdate),
'xxx',
0,
username
from phpbb_users;
insert into wp_posts (
id,
post_author, -- userid
post_date_gmt,
post_content,
post_title,
post_status,
comment_status, -- open
ping_status, -- open
post_name,
post_type
)
select
p.topic_id,
p.poster_id,
from_unixtime(p.post_time),
pt.post_text,
pt.post_subject,
'publish',
'open',
'open',
pt.post_subject,
'post'
from phpbb_posts p
join phpbb_posts_text pt ON p.post_id = pt.post_id
where p.post_id in (select min(sp.post_id)
from phpbb_posts as sp
where sp.topic_id = p.topic_id
)
-- and p.forum_id in ();
insert into wp_comments (
comment_post_id,
comment_author,
comment_author_email,
comment_author_url,
comment_date,
comment_content,
comment_approved
)
select
p.topic_id,
u.username,
u.user_email,
u.user_website,
from_unixtime(.p.post_time),
pt.post_text,
1
from phpbb_posts p
join phpbb_posts_text pt ON p.post_id = pt.post_id
join phpbb_users u on p.poster_id = u.user_id
where p.post_id not in (select min(sp.post_id)
from phpbb_posts as sp
where sp.topic_id = p.topic_id
)
-- and p.forum_id in ();
insert into wp_terms (
term_id,
name,
slug
)
select distinct
forum_id,
forum_name,
forum_name from phpbb_forums
--where forum_id in ();
insert into wp_term_taxonomy (
term_taxonomy_id,
term_id,
taxonomy
)
select forum_id, forum_id, 'category' from phpbb_forums-- where forum_id in ();
insert into wp_term_relationships (
object_id,
term_taxonomy_id
)
select distinct topic_id, forum_id from phpbb_posts
--where forum_id in ();
commit; - login to your wordpress admin
- confirm posts / comments
- export (under tools)
- convert your wordpress export at http://wordpress2blogger.appspot.com/
- import your converted wordpress export in bloggger
1 comment:
This script could be a HUGE help for me. Unfortunately, I get this error:
Error
SQL query: Documentation
INSERT INTO wp_users( id, user_login, user_pass, user_nicename, user_email, user_url, user_registered, user_activation_key, user_status, display_name )
SELECT user_id, username, user_password, username, user_email, user_website, from_unixtime( user_regdate ) , 'xxx', 0, username
FROM phpbb_users;
MySQL said: Documentation
#1062 - Duplicate entry '1' for key 1
Post a Comment