== FORUMOTION TO phpBB3 CONVERSION INSTRUCTIONS ==
[Scripts tested with phpBB3 3.0.0]
[To convert to a different forum software, modify members_topics_posts_XXXX.py accordingly]
Before you begin, make some
Profile changes (NOTE: If these changes are not done, conversion will probably fail!)
In your user profile preferences, choose the
English language
In your user profile preferences, set the date format to "
2008-03-29, 19:46".
In the administration panel, under General -> Messages and Emails -> Configuration:
Set "Posts Per Page" to the stated limit (probably 50)
Set "Always show the first post in the topics" to "No"
Set "Number of posts from previous page to display on last page" to 0
Set "Separate announcements and stickies from the messages" to "With a table".
In the administration panel, switch your theme version to phpBB3.
== REQUIRED STUFF ==
A Web Server with [preferably] MySQL.
Forum Software installed on this web server, configured and ready to go -- if you aren't using phpBB or SMF, you should convert to phpBB then use a converter to your software (a double conversion may cause a lot to be lost, but the topics, posts, forums and members should be intact)
Database Access - need to be able to insert, delete and truncate
Python (versions 2.5 to 2.6 will work, but Python 3 will NOT work!) -- download from
http://www.python.org= FORUM STRUCTURE =
1) The converter will crawl for forums, but you may have to fix the forum permissions as well as adding categories.
= POSTS AND TOPICS =
2) Change some settings in settings.py (edit the file)
table_prefix
When you set up your forum software, what prefix did you use (default will depend on the exact software used; it's usually the product name plus an underscore)
COOKIEDATA
Get this by entering this into the address bar while viewing any page in your Forumotion forum:
javascript:document.cookie
and copying the entire text of the page that appears.
The COOKIEDATA line should look like
COOKIEDATA=''
with the single quotes around your data.
URL
URL to the board's root (http://../)
sticky
A list of IDs which are stickied (pinned). You'll have to do this manually by going into each forum and recording the IDs of the pinned topics.
This is optional (set the sticky variable to [] to disable).
The line should look like
sticky=[1,2,3,4,5]
where 1,2,3,4,5 should be replaced by a comma separated list of pinned IDs.
lockimage
Location of the "Locked" image which appears in place of the usual "Post Reply" button.
[[Member settings]]
RANDOMNUMBER
a randomly chosen number used to generate member passwords, so they stay the same from run to run.
NUMUSERS
ID number of the most recent member. You can safely go much higher, since the crawler will only convert members with entries.
ADMINS
a set/list of the Admin user IDs (as they are in Forumotion). This allows the script to correctly set up the admin users.
The user IDs can be found in the user's profile URL: it's in the form
http://domain.com/profile.forum?mode=viewprofile&u=3) Run the members_topics_posts.py Python script (Windows: double click it; *nix use "python members_topics_posts.py" as a command)
4) Import the SQL batch files members.sql, categories_forums.sql, topics_posts.sql and to the forum database, using the character set (encoding) of your forum. They must be imported in that order!
For English forums, use the "latin1", "iso8859-1" or "cp1252" encoding.
For other languages, please check the encoding that your forum uses (you can find the selected encoding under Firefox's "View -> Character Encoding" or Internet Explorer's "Page->Encoding" menus), and import using that encoding.
Tip: Encodings which appear as "Windows-X" (where X is a number) are also referred to as "cpX" encodings.
5) [OPTIONAL] To notify members of the new passwords (randomly generated), run the pm_passwords.py file (configuring settings.py first to suit your needs).
[in settings.py]
msgtitle
The title of the personal message to send
msgbody
The text in the personal message. %%0A is a line break (new line), %s is the password (use this only once!)
If you must use a % sign for any reason, place two of them (%%), only one will show up in the PM. Failure to do so will result in a failed script run!
On the new forum:
1) In your ACP, resynchronize statistics, post counts and dotted topics (main ACP page),
Maintenance->Search index->Create Index for the active search method (if the Delete Index button is shown instead, click it first)
2) Use this script:
http://www.startrekguide.com/community/viewtopic.php?p=47648#p47648. This script is designed to resynchronize individual post data which this converter is unable to reproduce. Instructions are posted there.
- Code:
<?php
/**
* The file must be named resync_bbcode.php
*/
define('IN_PHPBB', true);
$phpbb_root_path = ((isset($phpbb_root_path)) ? $phpbb_root_path : './');
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('posting');
$start = intval(request_var('start', 0));
$limit = 200;
include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
$bbcode_status = ($config['allow_bbcode']) ? true : false;
$img_status = ($bbcode_status) ? true : false;
$flash_status = ($bbcode_status && $config['allow_post_flash']) ? true : false;
$sql = 'SELECT * FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t
WHERE t.topic_id = p.topic_id
ORDER BY p.post_id ASC
LIMIT ' . $start . ', ' . $limit;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
decode_message($row['post_text'], $row['bbcode_uid']);
$message_parser = new parse_message();
$message_parser->message = str_replace('"', '"', html_entity_decode($row['post_text']));
$message_parser->parse((($bbcode_status) ? $row['enable_bbcode'] : false), (($config['allow_post_links']) ? $row['enable_magic_url'] : false), $row['enable_smilies'], $img_status, $flash_status, true, $config['allow_post_links']);
if ($row['poll_title'] && $row['post_id'] == $row['topic_first_post_id'])
{
$row['poll_option_text'] = '';
$sql = 'SELECT * FROM ' . POLL_OPTIONS_TABLE . ' WHERE topic_id = ' . $row['topic_id'];
$result2 = $db->sql_query($sql);
while ($row2 = $db->sql_fetchrow($result2))
{
$row['poll_option_text'] .= $row2['poll_option_text'] . "\n";
}
$db->sql_freeresult($result2);
$poll = array(
'poll_title' => $row['poll_title'],
'poll_length' => $row['poll_length'],
'poll_max_options' => $row['poll_max_options'],
'poll_option_text' => $row['poll_option_text'],
'poll_start' => $row['poll_start'],
'poll_last_vote' => $row['poll_last_vote'],
'poll_vote_change' => $row['poll_vote_change'],
'enable_bbcode' => $row['enable_bbcode'],
'enable_urls' => $row['enable_magic_url'],
'enable_smilies' => $row['enable_smilies'],
'img_status' => $img_status
);
$message_parser->parse_poll($poll);
}
$sql_data = array(
'post_text' => $message_parser->message,
'post_checksum' => md5($message_parser->message),
'bbcode_bitfield' => $message_parser->bbcode_bitfield,
'bbcode_uid' => $message_parser->bbcode_uid,
);
$sql = 'UPDATE ' . POSTS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_data) . '
WHERE post_id = ' . $row['post_id'];
$db->sql_query($sql);
if ($row['poll_title'] && $row['post_id'] == $row['topic_first_post_id'])
{
$sql_data = array(
'poll_title' => str_replace($row['bbcode_uid'], $message_parser->bbcode_uid, $poll['poll_title']),
);
$sql = 'UPDATE ' . TOPICS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_data) . '
WHERE topic_id = ' . $row['topic_id'];
$db->sql_query($sql);
$sql = 'SELECT * FROM ' . POLL_OPTIONS_TABLE . ' WHERE topic_id = ' . $row['topic_id'];
$result2 = $db->sql_query($sql);
while ($row2 = $db->sql_fetchrow($result2))
{
$sql_data = array(
'poll_option_text' => str_replace($row['bbcode_uid'], $message_parser->bbcode_uid, $row2['poll_option_text']),
);
$sql = 'UPDATE ' . POLL_OPTIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_data) . '
WHERE topic_id = ' . $row['topic_id'] . '
AND poll_option_id = ' . $row2['poll_option_id'];
$db->sql_query($sql);
}
}
}
$sql = 'SELECT count(post_id) as post_cnt FROM ' . POSTS_TABLE;
$result = $db->sql_query($sql);
$cnt = $db->sql_fetchrow($result);
if ($cnt['post_cnt'] > ($start + $limit))
{
meta_refresh(1, './resync_bbcode.' . $phpEx . '?start=' . ($start + $limit));
trigger_error('The script is not finished yet, please wait. Part ' . (($start + $limit) / $limit) . ' of ' . intval($cnt['post_cnt'] / $limit) . ' is finished.');
}
else
{
trigger_error('Finished!');
}
?>
= FINAL TOUCHES =
Make sure to set your forum permissions correctly.
Manually add any moderators, themes or other settings.
= BUGS/INCOMPLETE CONVERSION NOTES =
- No Attachments
- No Polls