Search - User list
Full Version: punBB to DjanboBB Migration Tool
Root » The Other » punBB to DjanboBB Migration Tool
1
Kami
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.
slav0nic
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';

Kami
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).
slav0nic
in 1.2.12 sha1 without salt )
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB