In part one I looked at the technical approach I used for this unusual Delphi forums to phpBB conversion project. In the interim I have delivered something to the customer based on a somewhat dated extract they provided from their Delphi forums.
One thing I didn’t realize until recently was that moving their forums into phpBB was actually an interim state. The goal is to move it into bbPress, a WordPress plugin. Apparently bbPress can import from phpBB, but clearly not Delphi forums.
So it’s off to another contractor for that step. They might find they lose too much functionality moving to BBPress. phpBB after all has twenty years to mature and it has more functionality than any other forum solution, with one major exception in that it can’t do threads inside topics. Maybe that will show up in phpBB 4.0. If they lose too much functionality, they may keep it in phpBB, but they will need two sets of credentials because, in general, WordPress and phpBB don’t mix.
Some of the things I have learned and discovered since my last post:
- Their guy who provided a YAML extract made a GitHub project out of it, so feel free to use if it you dare.
- His parser though wasn’t perfect. It may be imperfections in Delphi’s software at fault. As noted in the last post, a few posts wouldn’t parse.
- Downloading the attachments was challenging. Delphi does its best to not let you download them outside of its system. I ended up using curl and passing some authorization cookies in curl to download them successfully. Once downloaded, they then needed to be copied into a files folder so that phpBB could find them.
- I had to write many PHP scripts to do the work and execute them in a defined sequence. Among these scripts were:
- One that calculated the attachment size and placed it in an attachments table
- A master script I called load_threads.php that did most of the initial work for reading the .yaml files and placing content into a set of denormalized tables that was used to store the posts and attachments data called phpbb_posts_load and phpbb_attachments_load. Subsequent scripts moved the data into phpBB 2 database tables after doing a lot of data jiggering.
- Not all attachments had file suffixes, so I had to figure out what kind of file types they actually were and rename them accordingly. The Unix file command has a -mime_type argument that helped a lot.
- One to load the users by examining user .yaml files provided in the extract.
- One to resize images so they would not exceed a maximum height or width.
- I also kept a set of notes documenting the sequence and issues discovered, and how to check the results. At points I had to move tables to my Raspberry Pi, which has PHP 5.6 installed, which can run the old phpBB 2 software, do some clean up there, then move the phpBB 2 database back to my machine so I could convert it to phpBB 3.3.
- I created some pretty exotic SQL to do things like update the first and last posts (and posters) for topics, set the post count correct for topics.
In short, it turned out to be pretty tedious and a learning experience, but is definitely doable with the right skills.