﻿<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="text" xml:lang="en">phpBB3</title>
  <link type="application/atom+xml" href="https://d.moonfire.us/tags/phpbb3/atom.xml" rel="self" />
  <link type="text/html" href="https://d.moonfire.us/tags/phpbb3/" rel="alternate" />
  <updated>2026-11-09T17:35:21Z</updated>
  <id>https://d.moonfire.us/tags/phpbb3/</id>
  <author>
    <name>D. Moonfire</name>
  </author>
  <rights>Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International</rights>
  <entry>
    <title>Using the PHPBB3 crawler convertor</title>
    <link rel="alternate" href="https://d.moonfire.us/blog/2013/11/12/using-the-phpbb3-crawler-convertor/" />
    <updated>2013-11-12T06:00:00Z</updated>
    <id>https://d.moonfire.us/blog/2013/11/12/using-the-phpbb3-crawler-convertor/</id>
    <category term="programming" scheme="https://d.moonfire.us/categories/" label="Programming" />
    <category term="phpbb3" scheme="https://d.moonfire.us/tags/" label="phpBB3" />
    <content type="html">&lt;p&gt;Last night, someone on Twitter asked about using a crawling convertor for a forum. In specific, a PHPBB3 to PHPBB3 conversion. However, the program involved was Python and a bit obscure to use. So, I offered to come up with a (possibly) easier set of directions of use.&lt;/p&gt;
&lt;p&gt;&lt;!--more--&gt;&lt;/p&gt;
&lt;h1&gt;What is needed&lt;/h1&gt;
&lt;p&gt;There are a number of programs that need to be used to use this conversion.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.python.org/getit/"&gt;Python 2.7.6&lt;/a&gt;: Download the 2.7.6 (not 3.3.1) for Windows MSI installer for 32 or 64 bit, whatever is appropriate for your machine.&lt;/li&gt;
&lt;li&gt;The bulk of the copying is done by the Converters scripts found  &lt;a href="https://www.phpbb.com/community/viewtopic.php?f=65&amp;amp;t=1761395"&gt;here&lt;/a&gt;. This uses a single user's login to walk through the contents of a forum and generates the SQL files which can then be imported into another forum.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Setting up the user&lt;/h1&gt;
&lt;p&gt;Before the program is run, you need to set up the user that will be walking the forum. Whatever this user sees will be converted, so if you have a private board or category, this user needs to have permissions for it.&lt;/p&gt;
&lt;p&gt;Because this walks a forum, you need to make sure your forum is generated in a consistent manner. Missing these steps is a good way of having a lot of trouble.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Login as the user you selected&lt;/li&gt;
&lt;li&gt;Click on "User Control Panel"&lt;/li&gt;
&lt;li&gt;Click on "Board Preferences"&lt;/li&gt;
&lt;li&gt;Click on "Edit global settings"&lt;/li&gt;
&lt;li&gt;Change language to "American English"&lt;/li&gt;
&lt;li&gt;Change your board style to "prosilver"&lt;/li&gt;
&lt;li&gt;Change your date format to Custom and enter "U" into the box.&lt;/li&gt;
&lt;li&gt;Click "Submit"&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Install Python&lt;/h1&gt;
&lt;p&gt;This should be as simple as double-clicking the MSI and following the prompts.&lt;/p&gt;
&lt;h1&gt;Installing and configuring the Converter&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Download the Converters.zip file&lt;/li&gt;
&lt;li&gt;Extract it to some location (&lt;em&gt;C:\TEMP\Converters&lt;/em&gt; is what I'm going to use)&lt;/li&gt;
&lt;li&gt;Go into that folder&lt;/li&gt;
&lt;li&gt;Copy &lt;em&gt;common.py&lt;/em&gt; and paste it into the &lt;em&gt;phpBB3&lt;/em&gt; folder&lt;/li&gt;
&lt;li&gt;Edit &lt;em&gt;settings.py&lt;/em&gt;
&lt;ul&gt;
&lt;li&gt;Change table_prefix to match what you use (you can get this from the &lt;em&gt;config.php&lt;/em&gt; file as &lt;em&gt;$table_prefix&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Change URL to the site of your old forum (same thing you gave me in the message)&lt;/li&gt;
&lt;li&gt;Change NEWURL to the new forum&lt;/li&gt;
&lt;li&gt;Change CONVERT_ATTACHMENTS to "True" or "False"&lt;/li&gt;
&lt;li&gt;Change RANDOMNUMBER to a big random number, important to avoid people from guessing your password&lt;/li&gt;
&lt;li&gt;Change NUMUSERS to the highest user ID (or just big a really big number)&lt;/li&gt;
&lt;li&gt;Save the file and exit&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Get the cookie&lt;/h1&gt;
&lt;p&gt;This step basically logs into the site and retrieves the needed information to walk the site. On Windows, double-click the &lt;code&gt;phpbb3_get_cookie.py&lt;/code&gt; script. It should open a window with some prompts, enter each one. As before, I'm using &lt;em&gt;Bob&lt;/em&gt; as the login.&lt;/p&gt;
&lt;pre&gt;Username? Bob
Password (hidden)? 
Success: got cookie for user Bob
Press &lt;enter&gt; to quit.&lt;/enter&gt;&lt;/pre&gt;
&lt;p&gt;Once this has run, there should be a file &lt;em&gt;cookie.txt&lt;/em&gt; in the direction. There will also be a &lt;em&gt;critical_errors.log&lt;/em&gt; which is hopefully empty.&lt;/p&gt;
&lt;h1&gt;Start the walking&lt;/h1&gt;
&lt;p&gt;This is the big step. Double-click on &lt;em&gt;members_topics_posts_phpBB3.py&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;Downloading Members...
Member 1 ... Downloading -                                                     
HTTP Error ignored: 404 Not Found
Member 1 ... Warning: Member doesn't exist!                                    
Member 2 ... Completed! User Password: 317887274831&lt;/pre&gt;
&lt;p&gt;And a bit later...&lt;/p&gt;
&lt;pre&gt;Forum index ... Completed                                                      
Category 1 ... Completed                                                      
 Forum 2 ... Completed: 8 topics found                                        
 Forum 7 ... Completed: 153 topics found                                      
 Forum 10 ... Completed: 11 topics found                                      
Category 44 ... Completed                                                     
 Forum 12 ... Completed: 4 topics found                                       
 Forum 47 ... Completed: 4 topics found                                       
  Forum 48 ... Completed: 30 topics found&lt;/pre&gt;
&lt;p&gt;And later...&lt;/p&gt;
&lt;pre&gt;Topic ID 42 ... Completed: 3 posts                                             
Topic ID 43 ... Completed: 1 post                                              
Topic ID 44 ... Completed: 1 post                                              
Topic ID 45 ... Completed: 3 posts&lt;/pre&gt;
&lt;p&gt;Finally after a long time...&lt;/p&gt;
&lt;pre&gt;Topic ID 1901 ... Completed: 4 posts                                           
Elapsed Conversion Time 746.45 seconds
Converted 7469 posts and 1646 topics.
Complete! Press &lt;enter&gt; to exit.&lt;/enter&gt;&lt;/pre&gt;
&lt;h1&gt;Importing the SQL&lt;/h1&gt;
&lt;p&gt;The output of the above program will be three files:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;members_phpBB3.sql&lt;/li&gt;
&lt;li&gt;categories_forums_phpBB3.sql&lt;/li&gt;
&lt;li&gt;topics_posts_phpBB3.sql&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Note, running these scripts will pretty much blow away anything you have, so make sure you don't have anything in the forum first.&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Connect to your MySQL instance of your new forum&lt;/li&gt;
&lt;li&gt;Run &lt;em&gt;members_phpBB3.sql&lt;/em&gt; with utf8 encoding&lt;/li&gt;
&lt;li&gt;Run &lt;em&gt;categories_forums_phpBB3.sql&lt;/em&gt; with utf8 encoding&lt;/li&gt;
&lt;li&gt;Run &lt;em&gt;topics_posts_phpBB3.sql&lt;/em&gt; with utf8 encoding (if you haven't figured that out yet)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Importing SQL is fairly easy. There are multiple ways, but I usually do this from the command line. Your ISP may provide a front-end for MySQL that does this.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SSH into your ISP for the new forum&lt;/li&gt;
&lt;li&gt;Run: mysql -u&lt;em&gt;username&lt;/em&gt; -p --default-character-set=utf8 &lt;em&gt;database&lt;/em&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;username&lt;/em&gt; and &lt;em&gt;database&lt;/em&gt; can be found from the config.php of the new forum.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Add the "mysql&gt;" prompt, type:
&lt;ul&gt;
&lt;li&gt;"SOURCE members_phpBB3.sql"&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Then repeat for the rest of the files.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Cleaning up the mess&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Log into your new forum&lt;/li&gt;
&lt;li&gt;Switch over to the Administrator Control Panel (ACP)&lt;/li&gt;
&lt;li&gt;Click on the "Run now" next to Resynchronize statistics&lt;/li&gt;
&lt;li&gt;Click on the "Run now" next to Resynchronize post counts&lt;/li&gt;
&lt;li&gt;Click on the "Run now" next to Resynchronize dotted topics&lt;/li&gt;
&lt;li&gt;Click on "Maintenance" tab&lt;/li&gt;
&lt;li&gt;Click on "Search Index"&lt;/li&gt;
&lt;li&gt;If there, click on "Delete index"&lt;/li&gt;
&lt;li&gt;Click on "Create index"&lt;/li&gt;
&lt;li&gt;Click on "Forums" tab&lt;/li&gt;
&lt;li&gt;Go through every single forum, sub forum, and sub-sub forum and click on the yellow recycle icon (resynchronize).&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Sending a changed password email&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Review the settings "msgtitle" and "msgbody" in the &lt;em&gt;settings.py&lt;/em&gt; file&lt;/li&gt;
&lt;li&gt;Double-click &lt;em&gt;pm_passwords.py&lt;/em&gt; to send out an email to all the users with the password
&lt;ul&gt;
&lt;li&gt;Alternatively, they can use "I forgot my password" and it should work&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Warning&lt;/h1&gt;
&lt;p&gt;Now, these are fairly generic directions and terrible things can happen if I missed something, but they should be easier directions to follow than the easier link.&lt;/p&gt;
</content>
  </entry>
</feed>
