[geeklog-devel] vbulletin conversion to new forum

Dwight Trumbower dwight at trumbower.com
Sun Feb 23 23:05:48 EST 2003


This is the script I used to convert vbulletin forum to the new 2.0 version. 

The orignal site: www.goldenbook.com
Temp new site. www.trumbower.com/golden  It is not IE friendly,must have a tag missing.



VBulletin conversion

-- execute the following statement and replace the number 4 with this new amount.

select max(uid) from gl_users;

INSERT INTO gl_users (uid,username,passwd,email,regdate,homepage,sig)             
SELECT  u.userid+4, u.username,u.password,u.email,u.joindate,u.homepage, u.signature
from user u;


INSERT INTO gl_userprefs(uid)
SELECT  u.userid +4
from user u;

INSERT INTO gl_userindex(uid,etids)
SELECT  u.userid + 4, '-'
from user u;

INSERT INTO gl_usercomment(uid)
SELECT  u.userid+4
from user u;

INSERT INTO gl_userinfo(uid)
SELECT  u.userid+4
from user u;

INSERT INTO gl_group_assignments (ug_main_grp_id, ug_uid) 
SELECT 13,  userid + 4
from user
where userid <> 1;

INSERT INTO gl_group_assignments (ug_main_grp_id, ug_uid) 
SELECT 2,  userid + 4
from user
where userid <> 1;

--use if you use categories in vb
INSERT INTO gl_forum_categories(id, cat_name, cat_dscp,cat_order)
SELECT forumid, title, description, displayorder)
FROM forum 
WHERE parentid = -1

-- use if there are no categories in vb
INSERT INTO gl_forum_categories(id, cat_name, cat_dscp,cat_order)
VALUES( 1, 'Forum', '', 0);

-- forums
INSERT INTO gl_forum_forums(forum_id, forum_name, forum_dscp, forum_order,grp_id, forum_cat)
SELECT forumid, title, description, displayorder, 2, CASE parentid WHEN -1 THEN 1 ELSE parentid END
FROM forum;
delete from gl_forum_topic;
drop table tmp;

-- topics
create table tmp
select min(p.postid) as postid , p.threadid as threadid
from post p, thread t
where p.threadid= t.threadid
group by p.threadid;

--header topic
INSERT INTO gl_forum_topic(id, pid, uid,name,date,subject,comment,topicimg, ip, sticky, forum, replies, views, mood)
SELECT DISTINCT p.postid, 0, p.userid + 4, p.username, p.dateline,t.title, p.pagetext, p.iconid, p.ipaddress, t.sticky, t.forumid,t.replycount,t.views,'no mood'
FROM post p, thread t, tmp t2
where p.threadid = t.threadid
and t2.threadid = t.threadid
and t2.postid = p.postid;

--children topics
INSERT INTO gl_forum_topic(id, pid, uid,name,date,subject,comment,topicimg, ip, sticky, forum, mood)
SELECT DISTINCT p.postid, t2.postid, p.userid + 4, p.username, p.dateline,p.title, p.pagetext, p.iconid, p.ipaddress, t.sticky, t.forumid, 'no mood'
FROM post p, thread t, tmp t2
where p.threadid = t.threadid
and t2.threadid = t.threadid
and t2.postid <> p.postid;

drop table tmp;


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist8.pair.net/pipermail/geeklog-devel/attachments/20030223/7c6b86ac/attachment.html>


More information about the geeklog-devel mailing list