Delphi forums to phpBB – Part One

Most of my work is pretty much the same: upgrades and updates to existing phpBB boards. Lately though I’ve been tackling some unusual projects. One of these is to move a Delphi board to phpBB.

Delphi forums are proprietary and are available only on their website. I understand it has no official way to export a Delphi forum. A board there has twenty years of conversations they did not want to lose. A clever user though has figured out how to export the board using YAML.

Example of YAML file for importing

After looking at it, I figured it was cost prohibitive to do. I did a proof of concept for them, demonstrating that I could read the YAML file and get basic user, forum, topic and post information from it, and display it neatly in HTML. I explained that this would be custom work and that it would take a lot of labor, even at my nonprofit rate. I estimated $2000 – $3000 and assumed it was cost prohibitive.

Proof of concept to display user information from YAML file

That was back in February but I was recently given the go ahead to start this project. Which raises the question: how on earth to do something like this?

What convertors from other forum solutions to phpBB that do exist tend to be for phpBB 3.0, and we’re now on phpBB 3.3. And no one has written a Delphi forums converter because it has no export capability. Since then phpBB has evolved, and due to the way post text is now encoded, it’s very challenging to write any new convertor.

Which is why I said if it can be done I would want to populate an old phpBB 2 forum with its data, and convert that to phpBB 3.3. There’s a convertor built into phpBB that does just this. But phpBB 2 became obsolete 13 years ago. However, its database is relatively simple so it should be straightforward to populate from data elsewhere.

But phpBB 2 was built for versions 4 and 5 of PHP, versions now obsolete and dangerous to use, or even acquire. It’s hard to even stand up a PHP 5 environment now. Most web hosting won’t support PHP 5, and mine doesn’t. So I’d have to roll my own development environment with PHP 5.

There are two ways to do this:

  • Via a virtual machine
  • Via a separate machine

I’ve used VitualBox on my Mac for years for standing up virtual machines. While it works, it doesn’t work well on a Mac. It’s a pain to use, particularly if you need to move files between the Mac and the VM.

Because I need PHP 5 for clients generally at least once a month, I decided a separate machine was more practical. So I bought a Raspberry Pi 4 (4GB) for less than $100. The actual machine is about $35 but I added a keyboard, mouse and a book. It took some help online to figure out how to install a web server and PHP 5 for it. The Pi is cheap because it uses RISC-based processors, so it’s not Intel compatible. Also, I could use FTP to move files to it, and using a free VNC viewer, I could work on it from my Mac desktop.

Processing the YAML turned out not to be easy. I tried various things, including PHP’s PECL YAML class, which I couldn’t get to work. I was able to eventually get Symfony’s YAML class to work.

Given the go ahead, I created a phpBB 2 board on my Pi with PHP 5.6 installed. While this worked great, my script wouldn’t run there. Symfony requires PHP 7.2. So I exported the phpBB 2 database and imported it into my Mac where I run PHP 7.4. I would have to populate the database from the YAML files I was given there, and eventually move it back to the Pi when it was time to try to upgrade the database.

Loading the phpbb_users table was not too challenging. A few fields needed to be escaped using mysqli_escape_string so the data could be loaded into the table. Some fields had to be trimmed to fit inside the maximum field length.

phpBB 2 places user data in a number of tables. Topics and posts haven’t been created yet, but there is a phpbb_user_group table. Each user had to belong to a group. Creating a test user on phpBB 2, I learned that it will create a new personal group. Then I had to write some SQL to put all 600+ users into this table. I also needed to populate a number of other columns in the phpbb_users_table. Each should have a new password, but since these users were added in bulk, they share the same password for now. All share the same bogus email address too, since I didn’t have that in the YAML. They will have to change both after the board is converted. Back in the old days, the password was encrypted with a simple md5 hash.

But the customer’s thread YAML wasn’t 100% clean. It wasn’t a major issue, but 22 threads (which amount to topics) wouldn’t parse. Even the good threads though had some issues. Some threads have no name to them. I will have to create a synthetic topic name for them. Some don’t have a forum name either, so those have to go into some sort of catch all forum.

There is a major issue is that the YAML’s attachment information provided a file upload name, but the name is not in the /files folder provided with the YAML. Files seem to have some sort of hash name. This may mean that attachments cannot be imported. If I want to import any attachments, I will have to install the old phpBB 2 attachment mod.

But at least this approach looks viable, if tedious. More learning experiences ahead.

phpBB 3.3 is released!

Two days ago, the phpBB group released its latest minor version of phpBB: 3.3, also known as Proteus. You can learn more about it on its launch page. To give you some perspective, phpBB 3.2, the last minor version, was released on December 9, 2016. So it’s been three years since the last minor release of phpBB.

I looked at a development version a couple of weeks back. So I was kind of taken by surprise by 3.3’s sudden release. Minor versions tend to introduce some new functionality, and Proteus does. It’s just that for most administrators and users, it won’t seem like that big a deal and things will look and behave pretty much the way they always have. As with phpBB 3.2’s introduction, most of its changes are covert, rather than overt. Unless you know what you are looking for, you won’t notice much.

New logo

One hard-to-miss feature, at least if you use the default proSilver style, is the phpBB logo is different. It’s now a Scalable Vector Graphic (SVG), which makes it look crisp and shiny in all resolutions, including retinal displays. It looks a tad bigger, but also more white and almost glossy. Also, the logo includes the words “forum software”, which is new. Previously, the logo was a transparent GIF and it said “Creating communities”.

New phpBB logo
New phpBB logo

Updating is getting easier

Updating phpBB is getting easier too. It won’t compare to updating WordPress, which takes place entirely behind the scenes and can be done with a single click. The exact mechanics of how it will work is unknown until 3.3.1 is released. But the launch page says:

“With our brand new installer updating will be easier than ever in phpBB 3.3! Upload a single folder to your board and all your files will automatically be replaced.”

This will be welcome because updating has always been a hassle. Over time, it may affect my income a bit since a lot of it comes from updates. I expect a lot of my customers will still want me to do this as a service.

You will still need to upload one file, an archive. I also expect there will be a number of other manual steps, because there will always be issues of overwriting custom changes to styles and extensions that may have issues. You will probably have to back up your styles and extensions folder manually before updating. Time will tell.

New PHP requirements

Proteus requires PHP 7.1.3 or higher, and cannot use a version of PHP greater than 7.4. So many administrators will have to upgrade PHP first, which may be an issue for those using PHP 5.4 and 5.6. They will finally have to take the plunge.

Most likely a lot of these boards will have an issue: they will need to edit their config.php file to tell phpBB to use mysqli drivers instead of mysql drivers. So far, fixing this issue has not been intuitive.

Overall, taking the plunge to PHP 7 is good: twice the performance compared with PHP 5 and phpBB can use many new features in PHP 7 too. I have noticed some extensions have issues with PHP 7, however, for example the AWS S3 extension.

Upgrading from phpBB 3.2

The upgrade process from 3.2 is pretty much unchanged from 3.1 to 3.2, and will be more manual in nature than the newer upgrade process. You can see the steps required here.

Improved Emoji support

From a user’s perspective, the exciting feature is likely to be increased Emoji support. Previously, only certain Emoji characters could be used, and only in post text. Now you can use virtually any Emoji character, and you can use them in topic titles too. However, you cannot use Emoji in the subject line of topic replies.

The Emoji in topic titles permission is enabled by default. If you want to disallow it, the easiest way is to change a user role, like Standard Features. ACP > Permissions > Permission roles > User roles > [Role name]. Click on the green wheel for the role. See illustration:

New emoji in topic titles permission
New emoji in topic titles permission

Over time, phpBB forums will look a lot more colorful and visual.

No support for IE before IE11

Also with Proteus, phpBB essentially gives up caring about Internet Explorer versions 7-10. It’s not that phpBB won’t render pages with these older browsers, but certain features won’t work or may behave quirkily. This is because to do fancier things, phpBB relies on a Javascript library called jQuery. It now uses a newer version of jQuery which is not compatible with these older browsers. The phpBB Group’s rationale is that since Microsoft won’t support old versions of Internet Explorer, they don’t have to either.

Some other features they are highlighting:

  • Clever quotes. Quotes can show a link to the post and post author. It can also show the date and time of the quoted post.
  • Improved reCAPTCHA. Previously only reCAPTCHA V2 Checkbox was allowed for a reCAPTCHA solution. Now you can use the Invisible reCAPTCHA V2. One consequence of this is that the V2 Checkbox is no longer supported, so as part of upgrading phpBB to 3.3 you should have to get a new set of reCAPTCHA keys from Google’s reCAPTCHA site that support this method, and plug them into the Spambot Countermeasures area in the ACP.
  • Notifications are supposed to be very fast now. The whole notifications process has been reengineered. It’s unclear if this means email notifications are sped up. I’m pretty sure they will go into phpBB’s mail queue like they do now, so your Email settings should apply.
  • FontAwesome improvements. In phpBB 3.2, phpBB supported a rather limited set of scalable FontAwesome characters. The number supported are now much larger, and they will all look fine on retinal displays.
  • Symfony 3.4. This is behind the scenes stuff, but phpBB 3.3 uses a newer version of the Symfony PHP libraries, including its heavily used template engine.
  • ACP Statistics screen is now responsive. As noted in my first look, the statistics panel in the ACP now splits statistics into two groups, which has the benefit of making the screen responsive. You can see the new look below:

New ACP Statistics screen
New ACP Statistics screen

Should you upgrade?

You probably don’t want to upgrade right away. This is because some of your extensions may not work and if you made changes to your style, those won’t carry over so they will need to be replicated.

However, the same day the phpBB Group also released phpBB 3.2.9, which brings over some of these features including Emoji support. You might want to update to that version for a few months until extensions and your style becomes compatible with phpBB 3.3.