DjangoBB

Django based forum engine

  • You are not logged in.

#1 Dec. 6, 2009 21:38:36

Kami
Registered: 2009-12-06
Posts: 2
Reputation: +  0  -
Profile   Send e-mail  

punBB to DjanboBB Migration Tool

Hello,

punBB to DjangoBB is a little tool for migrating from punBB to DjangoBB (actually, it is a PHP script which generates Python script + custom authentication backend).

I made this primarily for my personal use, because I wanted to switch my forum to DjangoBB, but someone else might find it useful as well.

You can download the script here and the short how to is available on wiki.

If you find any bugs or problems, please let me know.

Offline

#2 Dec. 7, 2009 19:38:46

slav0nic
DjangoBB Developer
From: Ukraine
Registered: 2009-10-25
Posts: 382
Reputation: +  5  -
Profile   Send e-mail  

punBB to DjanboBB Migration Tool

Tnx!
later i planing write migrator . Now i do this over sql scripts like this:

1. select to csv fron PunBB mysql DB:

SELECT * INTO OUTFILE '/tmp/dbb_migrate/categories.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY "'" LINES TERMINATED BY '\n' FROM categories;

SELECT id, cat_id, forum_name, disp_position, forum_desc, FROM_UNIXTIME(last_post), num_posts, 0 INTO OUTFILE '/tmp/forums.csv' LINES TERMINATED BY '\n' FROM forums;


SELECT id, username, ' ', ' ', email, CONCAT('sha1$$', password), False, True, False, FROM_UNIXTIME(last_visit), FROM_UNIXTIME(registered) INTO OUTFILE '/tmp/usersa.csv' LINES TERMINATED BY '\n' FROM users;


SELECT id, id, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 0, 'ru', ' ', 'default', True, True,0, 'bbcode', num_posts    INTO OUTFILE '/tmp/users.csv' LINES TERMINATED BY '\n' FROM users where id!=1;

SELECT id, topic_id, poster_id, FROM_UNIXTIME(posted), FROM_UNIXTIME(posted), 'bbcode', message, '', '',  poster_ip INTO OUTFILE '/tmp/posts.csv' LINES TERMINATED BY '\n' FROM posts


SELECT t1.id, t1.forum_id, t1.subject, FROM_UNIXTIME(t1.posted),  FROM_UNIXTIME(t1.last_post), t2.id, t1.num_views, t1.sticky, t1.closed, t1.num_replies INTO OUTFILE '/tmp/topics.csv' LINES TERMINATED BY '\n' FROM topics as t1, users as t2 WHERE t2.username = t1.poster

2. Convert csv to utf via iconv tool

3. Load to DjangoBB Postgresql DB:
copy forum_forum(id, category_id, name, position, description, updated, post_count, topic_count) from '/tmp/forums1.csv';

copy auth_user(id, username, first_name, last_name, email, password, is_staff, is_active, is_superuser, last_login, date_joined) from '/tmp/usersa1.csv';

copy forum_profile from '/tmp/users1.csv';

copy forum_topic(id, forum_id, name, created, updated,user_id,views, sticky, closed, post_count) from '/tmp/topics.csv';

Edited (Dec. 7, 2009 19:40:41)

Offline

#3 Dec. 8, 2009 14:59:46

Kami
Registered: 2009-12-06
Posts: 2
Reputation: +  0  -
Profile   Send e-mail  

punBB to DjanboBB Migration Tool

No problem.

Too bad I didn't remember using CSV import and export before, it would probably take less time

By the way, how do you handle user authentication?

As far as I know, punBB 1.3.x generates the user password hash by using the sha1 hash function on raw password, appends the digest to salt (which is different for every user) and then uses sha1 hash function on this string again (not sure if it did the same in 1.2.x).

Offline

#4 Dec. 8, 2009 18:02:05

slav0nic
DjangoBB Developer
From: Ukraine
Registered: 2009-10-25
Posts: 382
Reputation: +  5  -
Profile   Send e-mail  

punBB to DjanboBB Migration Tool

in 1.2.12 sha1 without salt )

Offline

Board footer

Moderator control

Powered by DjangoBB

Lo-Fi Version