Blog

Digests 3.2.7 released

This extension is still not approved. The phpBB extension review team found more issues, all very minor.

It’s taken a long time to put out a new release because I had to wait a few months for a review, and then I had to puzzle my way through bugs that were introduced into phpBB’s migrator in phpBB 3.2.2 which in many cases kept digests from installing correctly. It’s all pretty annoying but issues like this are bound to creep in from time to time. Anyhow, version 3.2.7 is released. With this release I’ve retested installing digests from a database upgraded from phpBB 3.0 with the digests mod installed. Apparently I hadn’t retested this since the 3.1 version of digests. Using this approach you can retain your digest settings from the mod.

You can download this version from my digests extension page or on the GitHub branch.

Most of the change log is pretty technical and arguably irrelevant but you should pay attention to bug fixes and functionality changes.

Bug fixes:

  • Fixed HTML5 validation issue with Edit Subscribers, closing </textarea> was missing
  • Fixed HTML5 validation issue with Balance Load, added three <col> tags
  • UCP dialog error fixed by adding additional code to jQueryUI interface
  • Moved posts are not included in a digest
  • Configuration variable phpbbservices_digests_strip_tags added by the migrator, was missed from earlier version

Changes in functionality:

  • When the manual mailer is run, the file name includes a hash for added security

Extension team review fixes:

  • Replaced isset($_REQUEST[‘config’]) with $this->request->is_set(‘config’)
  • Replaced addslashes($balance) with $this->db->sql_escape($balance)
  • Removed !defined(‘IN_PHPBB’) in mailer
  • Moved code to load messenger class inside the mail_digests function in cron/task/digests.php

Best practices:

  • Replaced sizeof() with count() as sizeof() is an alias of count()
  • Removed redundant conditional operators where unnecessary
  • Removed unneeded casting of function return values where unnecessary
  • Used $html_messenger->assign_var() when only one template variable needed to be set instead of $html_messenger->assign_vars()

CSS:

  • Included ACP and UCP .css file through a switch, so they would not be loaded by other modules
  • Edit subscribers now shows alternating row colors properly

Javascript:

  • Included ACP and UCP .js file through a switch, so they would not be loaded by other modules
  • Fixed some variable names that were not using camelcase
  • addToStack() function logic now uses jQuery
  • Removed redundant conditional operators where unnecessary
  • Added var in front of variables that did not use them

ACP Interface:

  • Removed query for f_list privilege, unneeded
  • Used constants DIGESTS_DAILY_VALUE, DIGESTS_WEEKLY_VALUE and DIGESTS_MONTHLY_VALUE instead of literals
  • Properly indented code in templates

UCP Interface:

  • Properly indented code in templates

services.xml:

  • helper class is no longer passed to main_listener class as it is no longer needed

html_messenger.php:

  • Brought copied functions up to date with functions in version 3.2.2 of /includes/functions_messenger.php

Migrations:

  • Lots of work to simplify and address issues, some related to bugs in the migrator introduced in phpBB 3.2.2
  • Conversion from digests mod: now properly converts configuration variables, modules and schema changes during enabling the extension if these remain in the database after upgrading from phpBB 3.0. This allows digest settings to be retained. Apparently this functionality never worked on phpBB 3.2. To get around what look like migrator bugs in phpBB 3.2.2, old modules are deleted with a direct database call. Note: if AutoMOD was used to install Digests, you need to remove AutoMOD modules manually. The symptom is an ACT_CAT_MOD tab appears in the ACP.
  • Updates configuration variable to point to new digests web page URL
  • Helper container removed as it is no longer needed
  • release_3_0_6.php removed
  • common.php linkage removed as it is not used anymore

May 2018 work summary

Things were a bit slow in May, at least for the first two weeks. Curiously all my work was for existing clients. The theme of my work in May: getting rid of spam and preventing it.

  • Client #1
    • May 4. I helped fix an outgoing email issue on GoDaddy hosting. phpBB notifications were being blocked by GoDaddy from going out, something that you would never know if you don’t call their technical support line and press them. GoDaddy detected malware on the domain but after running a scan could not find any. They required that the customer certify that there was no malware on the site before unblocking outgoing email. In response I created an email forwarder for the domain and made this the board contact email. Not having an email address for outgoing mail associated with the domain is often the root of these problems. Customer called GoDaddy, they reenabled outgoing email and notifications started going out again.
    • May 12. Issues with spam posts on the forum despite using the reCaptcha V2 spambot countermeasure setting in phpBB. Customer was paying extra for a GoDaddy Securi service that automatically detected and removed suspected malware, but which removed some valid software introducing issues. Securi zeroed out some software files that kept me from logging in. After I eventually figured out the problem, I replaced the two files and I was able to log in. Earlier I had removed copies of mods in the store folder (used when the board was using phpBB 3.0 software) that were flagged by GoDaddy as malware. There were recent spam posts and it’s unknown how they happened. It’s possible the spammer solved the reCaptcha manually. I deleted about 150 inactive and likely spam registrations via SQL. I provided user with a list of posters since 4/1/18 so he could make a judgment as to whether these were spam registrations. I provided instructions on removing these users and their posts. I reinstalled Tapatalk since it was not working. I had to do it through File Manager since FTP wasn’t working. mChat extension wasn’t working either. I tried to reinstall that too but it didn’t work. I needed to reupload all phpBB software files since components were probably removed by Securi. Noticed navigation icons were removed too. Talking with GoDaddy they disabled the firewall and got me FTP access again. I re-uploaded folders where Securi had changed things. This seemed to fix remaining issues. After purging the cache, mChat started working and icons reappeared. Uploaded Cleantalk but not enabled. Providing instructions for configuring it if client wants to use it. Had GoDaddy disable firewall. Customer may want to stop paying for it.
  • Client #2
    • May 12. Since my last work for client they moved their forum to a dedicated server. Could not get in with FTP credentials. Used file manager instead. Installed release candidate of Thanks for the Posts extension. It will work with Tapatalk if the mobiquo directory is replaced. Did that and tested and it seemed okay. Installed a beta Modern Quote extension. Hid the portal page link because a sidebar would not show on right due to styling issues. Changed server settings, cookie settings and .htaccess file to accommodate HTTPS. There were some issues with getting cookie settings to work correctly. I also had to change some URLs in the posts table to https and fix some ads that were showing http in the URLs. To accommodate a Discord chat widget client wanted on the sidebar, I created a .css file it uses and linked it in in overall_header.html. I placed it at the bottom of the right sidebar in a custom widget in the Board3 portal, but there were connection issues since the service was not authorized that the client fixed. I fixed a phpBB Gallery integration issue. In the config table, the row containing phpbb_gallery_num_comments was blank when it needed an integer, trigger a SQL error. Set it to 1 since there was only 1 comment in the gallery so far. Fixed edit mchat post issue so an admin could edit the chat post due to white text on white background. Applied mChat patch to force the window to scroll to bottom in mChat. Fixed background and text color of Discord widget with an inline style to the widget since the board portal stylesheet was overruling it. Clock widget bottom part did not refresh on Chrome, but does on Firefox. Not sure it can be fixed (browser quirk) so client removed it. Checked background color issue for multi-quote. It’s black for me. Does not appear to be permissions based.
    • May 13 – Changed the background color for Gallery display, was white, commented out in CSS. User provided a watermark and I added that. Changed cookie name, forces a new login.
    • May 14 – Sorted through issue with Gallery watermarks (should be applied to subsequent images) and virtual URLs it creates. Disabled Image upload extension.
    • May 16 – Mostly answered new questions, changing some settings such as a PHP maximum upload size. Installed Search User Topics extension.
    • May 28 – Client asked me to update the version of Tapatalk to 2.1.10. However, it didn’t integrate well with version of mobiquo supporting the Thanks capability. To get things stable, we eventually reverted back to Tapatalk version 2.0.8.
  • Client #3 
    • May 16 – Time consuming phpBB upgrade on dreamhost.com virtual private server from phpBB 3.0.14 to 3.2.2. Over 1.2M posts, took 3 days! Running a database update quickly failed. Tried the command line interface instead. Even then it was excruciatingly slow. Broken SSH connection overnight meant a restart which bogged down. A chat with tech support finally revealed the upgrade slowness issue: insufficient RAM for the database. Bumped it to about 600MB and the conversion finally completed. Everything was straightforward thereafter. Used the black style which I changed to make red type rather than blue to match the look under phpBB 3.0. I replaced the logo. I added the latest Tapatalk extension and enabled it. I added Cleantalk extension and gave instructions on how to enable it with a key from the website. Turned on its spam firewall feature. I created a robots.txt file to deny all robots. I enabled reCaptcha V2 spambot countermeasure. Changed group color for administrators so they could be seen easily in styles.
    • May 17 – Additional work. MySQL too many connection errors kept happening. Spent time with tech support on this issue. MySQL settings cannot be changed for the VPS type of account. Some users were reporting bogus login errors. Disabled Cleantalk and think that will solve the issue until Cleantalk is properly set up. Added prosilver_se style for visually impaired users who can’t see dark style well. Installed Quick Style extension so styles could be easily changes. Changed blue text colors to white but cannot change color of icons since they are images — would need new set of icons colored correctly. Client wants to jump to the first unread post of a topic when clicking on topic icon. Found a hack for it but advised against it.
    • May 18. Investigated some new issues. The search index unavailable message when posting, but post was saved. Changed search index to phpBB Native. Installed Naruto shipuuden style and tweaked it to place logo and make it look right.
    • May 19 – Answered some questions. Installed Thanks for the Posts (Release Candidate) extension. I did more tweaking of newest style to make it look more uniform.
    • May 20 – Answered a lot of questions. Think the too many MySQL connections issue is either related to Tapatalk’s mobiquo directory or needing to change the storage engine for tables to InnoDB. Updated Cleantalk extension to latest minor version. Changed PHP from 5.6 to 7.0. Uploaded version of mobiquo for Thanks for the Post extension.
    • May 21 – Installed ShareOn extension. I found a way to get to MySQL prompt for potential change of tables storage engines to InnoDB. Changed a lot of forum permissions. Explicitly gave Thanks for the posts permissions where necessary. Verified it worked in Tapatalk with the replacement mobiquo folder they provided.
    • May 22 – I changed all table storage engines from MyISAM to InnoDB. The search wordmatch table took about six hours to convert. This resolved the MySQL too many connections problem, probably because tables were being locked and unlocked more efficiently and at the row level instead of the whole table level. I also installed the Media Embed plugin. I wrote a little blurb of instructions for client’s users and provided a screenshot for using the Media Embed plugin.
    • May 24 – I installed Advanced BBCode Box 3 extension to make it easier to embed videos.
  • Client #4. To address a persistent spam problem, I installed the latest version of Cleantalk and changed spambot countermeasure to reCaptcha V2.
  • Client #5. To address another spam problem, I installed Cleantalk extension on two domains.
  • Client #6. Client had a major spam attack with thousands of spam posts and spam registration. Configured reCaptcha V2 on phpBB 3.2.1. Then installed Cleantalk extension. However, there were issues while removing spam with Cleantalk, first hosting timeouts, then duplicate rows in phpbb_notification_types table. Emptying this table eventually worked. Removing spam was a combination of some SQL on the backend plus Cleantalk extension.

Cleantalk extension for phpBB can remove spam posts, plus its spam firewall feature is very useful

This is an update on an earlier post on removing spam posts.

Removing spam posts is hard because it requires actually reading the post and deciding if the post is spam or not and then using moderator tools to remove these posts. If your forum is overwhelmed with spam posts, this is a Herculean endeavor. Ideally though posts could be “read” by software and it would make the judgment on whether it is spam or not.

The Cleantalk extension for phpBB 3.1.x and 3.2.x can do just this as well as lots of other really cool tricks. My customers love Cleantalk, but the service is not free. However, it is so inexpensive that it easily justifies spending $8/year for the service. You can subscribe on the Cleantalk website. As of this writing, you can try it for free for 7 days. After 7 days, it won’t bring down your forum but it will stop working.

What is Cleantalk?

Cleantalk is essentially a huge database of addresses of known spammer sites. While it’s not perfect, based on the experience of my clients it is about 99% perfect. I originally recommended it as a spam registration solution for my clients. It still does that but is less necessary since phpBB 3.2. This is because since phpBB 3.2, version 2 of Google’s reCaptcha is supported. Unless it gets hacked, as long as you have it properly configured as a spambot countermeasure it should prevent virtually all spam registrations.

However, it has two powerful features that still keep it relevant for phpBB forums.

Cleantalk ACP Interface
Cleantalk ACP Interface

Installing and enabling Cleantalk

Cleantalk is installed like any other extension. While it can be downloaded from phpbb.com, you should download it from Cleantalk instead or from its GitHub page. This is because as of this writing the version on phpbb.com does not include the spam firewall feature, and you will probably want to enable this feature. You can access it through the Administration Control Panel: ACP > Extensions > Antispam by Cleantalk. Before you can do much with it you have to enter your Cleantalk key which you can get from their website or by pressing the button in the extension that should retrieve it for you.

Removing spam users and spam posts

As you can see from the image, once the extension is enabled and the key is properly configured there is a prominent Check users for spam button on its page within the Administration Control Panel. If you have lots of users, it may hang. Based on my experience though the next time you go into its interface you will see a list of potential spammers.

As I said, it is not perfect. So I recommend that for users with posts to check these out these users topics to make sure their posts are spam before deleting them. For those you want to delete, check the boxes next to their usernames and then press Delete marked. You can also press Delete all to remove all users and their posts. You may have to go through many pages to delete all spam users and their posts, but this is obviously much faster than doing a visual inspection of all your posts.

Spam firewall

This is a new feature which as of this writing is not available if you download the extension from phpbb.com. It keeps almost all spammers from hitting your site at all. Instead, Cleantalk’s servers grab it first. In the event the user is legitimate, there is a link that will take them to your website.

Why is this useful? Because it reduces the stress on your server by limiting it to legitimate traffic only. It speeds up the performance of your forum and makes it less likely that you will have to pay for the cost of a higher class of hosting to handle your traffic. Isn’t that worth $8 a year?

Stopping contact form spam

Cleantalk has one other useful feature: the ability to stop contact form spam. Of course you can disable the contact form (ACP > General > Contact page settings) and that will solve that issue. Or you can have Cleantalk essentially moderate it for you, passing on only valid contact forms to you. Simply check that option on the extension’s page and submit the form. Somewhat oddly, the phpBB group did not tie the contact form to the spambot countermeasure feature of phpBB. Perhaps that will come in a future release.

In any event for forums that get lots of spam and/or lots of traffic, using the Cleantalk service with the Cleantalk extension for phpBB is a no-brainer providing you know about it. Now you do!

MediaTemple grid service no longer recommended

It’s sad for me to say this, but I can no longer recommend MediaTemple’s Grid service as a hosting option. For the last 18 months or so I’ve been using this service and have gotten increasing dissatisfied and exasperated by it. Today I started the process of moving my domains off of it to Siteground.com even though I have four and a half months left on that hosting contract. This domain should now be coming to you from siteground.com servers and hopefully in a reliable and maybe spiffy fashion.

MediaTemple.net was known as one of the premier providers of business-class hosting. It was acquired by GoDaddy with the promise that it would be separately managed. It appears from my experience with their Grid service that they broke that promise with their customers. Sometimes I have to wait a minute or more to retrieve pages from my own site. It sure looks like they are overloading their servers and/or managing them very badly.

I used UpTime Robot to test whether my domains are up. Pretty much every day I will get one or more emails telling me it is inaccessible. So it was likely costing me money, motivating me to move to Siteground.com instead.

I do have clients using MediaTemple’s virtual servers and they have no complaints about that service so far. Definitely avoid their Grid service now and if you have an option you might choose some other host for your virtual or private server needs. I don’t have experience with Siteground’s, but it’s likely fine. A company like Rackspace.com is likely doing it right.

Another annoyance was revealed simply in moving my site. An old phpBB forum I have with about 50,000 posts could not be downloaded. I had to break it down into multiple downloads, including the posts table into two separate downloads. The Grid service simply cut me off when I hit some sort of resource limitation. The whole database is only 80MB or so. Shame!

April 2018 work summary

In contrast to March, April started out busy and ended up slower. This is in part because much of my March work continued into April. Anyhow, here’s what I worked on for clients in April. As always, I do not identify my clients by name or domain unless they specifically allow it:

  • I spent a lot of time continuing work for a client I started working for in March. Their WordPress site integrates phpBB into a separate area.
    • First I completed the move of the forum from phpBB 3.0 to 3.2. The hard part here was making changes to the phpBB style to integrate the overlaying WordPress theme in the headers and footers, as there were many CSS class and HTML ID conflicts.
    • As part of the upgrade, the client took the plunge and moved the site from standalone web pages to WordPress. A lot of scripts written by someone else to monetize particular types of posts broke because of changes to phpBB’s API. These old programs were “tightly coupled”, to use a software engineering term. Basically as these broke I fixed them by updating the phpBB code inside these programs. Most of this work involved changing $_SERVER, $_GET and $_POST statements to use phpBB’s request object instead. 
    • With the new WordPress framework, some of the old content appearing in sidebars needed to move into WordPress widgets in the sidebars of the theme. We’re taking this piecemeal, learning as we go along. A better “loosely coupled” way to get phpBB content in WordPress is to use phpBB feeds. phpBB comes with a built in Atom feed that needs to only be enabled. But it doesn’t do everything to retrieve relevant posts. WordPress has a feed widget and there are also a number of other widgets available as plugins that do a fancier job of serving feed content from Atom or RSS feeds inside of WordPress. In the case of my client, the sidebar needed to show recently posted topics in the forum. I eventually decided I needed something beyond phpBB’s Atom feed, so I chose my own Smartfeed extension instead. However, it didn’t return quite what the client wanted as he only wanted “fresh” topics from a certain forum, and only the latest post from these topics. I was able to tweak my Smartfeed extension to do this, and this inspired me to work on a new release of Smartfeed to add these features. Once deployed, I will update the version of Smartfeed I installed for this client to use it instead.
    • I fixed an issue with moderator permissions with the forum by adding these moderators to a list of global moderators.
    • Installed a SiteMap extension so posts were better available to search engines.
  • Upgraded a forum from phpBB 3.2.0 to phpBB 3.2.2. Replaced the logo in the original dimensions. Upgraded Cleantalk to latest version on GitHub. Enabled the spam firewall feature of Cleantalk. Installed announcement on index extension for 3.2 (not official). Fixed issue with wrong reCaptcha. Checked global moderator privileges and they were okay. Administrator moderator role was changed to Full Moderator.
  • Upgraded Tapatalk extension to version 2.0.8. This also meant removing the mobique directory and reuploading that.
  • Changed the people who have moderator privileges for a client.
  • This work was a bit different. I created two MySQL triggers so if a user is added to a particular group by an administrator they are subscribed to receive notifications if new topics are created in a forum. I also created a trigger to remove the forum notification if they are removed from the group.
  • A client needed URLs embedded in the post text changed as the image hosting service has moved it to a new domains (postimg.cc and postimages.cc). It’s fairly simple to do once I finally figured out about the MySQL replace function. I also installed the Member Profile Views extension (1.0.3) for the client. Later, I updated the Cleantalk extension to the latest version. While I was in there removed 3 dead extensions from the extensions table that were showing as ugly error messages on the Install extension screen. I also help create a new BBCode to serve embedded videos from a site and updated the latest version of phpBB Gallery from the GitHub master: version 3.2.2.
  • Upgraded a forum from phpBB 3.0.11 to phpBB 3.2.2. Installed Allan Style Subsilver. Placed a new logo. Installed Advertisement Management extension and placed two old ads, changing the image URL a bit. The forum has 200,000 posts. One minor issue during upgrade: I had to make active the prosilver style for it to complete.
  • Completed a messy upgrade from phpBB 3.0.12 to 3.2.2 on GoDaddy hosting. The file folder was missing and was apparently dropped a month or so back when user went over quota, and was not recoverable. This meant lots of images embedded in posts would not show. The user has to live with this. I had to move the database to my machine to convert it, due to severe resource limitations on GoDaddy. The phpBB native search index creation did not work, so I created a MySQL Full Index one instead. mChat was previously installed as a mod. I had to manually remove all traces of it to get the mChat extension to install. Many tables were missing primary keys, indexes and automatic increment settings. I eventually figured out this was an issue with bigdump.php, a staggered MySQL importer I used, as it nears the end of a database extract file sometimes and hangs. These are stored at the bottom of the file and it never said it completed. It took an hour or so to create the missing indexes and primary keys. I did not move over tables for the search index, topic tracking information, the session information or the logs due to size issues. I could not find a way to remove spam posts easily but did remove old inactive users. Installed reCaptcha V2. Installed Tapatalk, Advertisement Management (to place ads at top and bottom), ShareOn, mChat (after cleanup) and OneAll Social Login extensions. Adjusted forum permissions so newly registered users could post without permission and gave full access permissions to all forums for all major groups.
  • As with the first client, I changed some URLs in the post text to use postimg.cc and postimages.cc. This one though was a bit different because periods were stored as HTML entities in the database. I also spent an hour trying to make the upload attachments feature work since he did not want to use external services anymore for posting images and he had plenty of space. There were lots of permissions issues to puzzle through. I had to change forum access privileges for registered users to full access. I also had to set the upload permission for the registered users to allow it and change the quota for uploaded images from just 1MB to 10GB.

Issues installing the digests extension on phpBB 3.2 when digest mod was installed on phpBB 3.0

For reasons that are not entirely clear to me there are issues when installing the digests extension on phpBB 3.2 if you are carrying over digest settings that were in place on phpBB 3.0 where the digest modification was installed. Most likely there were subtle changes in the phpBB modules library. Please see the first post of the digests extension topic for current instructions to use in this case.  The new additions are copied below:

You should remove any old AutoMOD and digests modules before installing Digests.

Since the digests mod was often installed using AutoMOD, there may be a bogus ACP_CAT_MODS tab when you go into the Administration Control Panel. phpBB’s upgrade program isn’t smart enough to remove these. Clicking on the tab will usually trigger an error that tells you the module for AutoMOD no longer exists. (Of course it should not. The AutoMOD program should have been removed with the upgrade of your forum from 3.0 to 3.1 or 3.2.) These can be manually removed on the System Tab, Module Management, Administration Control Panel. You will have to descend the module tree and remove modules from the bottom up, eventually removing the tab altogether. You must do this prior to installing digests if you are importing digest settings from what was at one time a phpBB 3.0 database with the digest mod installed. If you don’t, you will likely get errors when trying to enable the digests extension. Make sure you remove all modules under this tab and what used to be the .MOD tab (now ACP_CAT_MODS tab).

It’s recommended that you remove old digest modules through the database before installing digests

The installer was designed to clean these up. However from what looks like quirks in the phpBB 3.2 modules library, you may get errors. Enabling the extension again usually solves the problem. It’s better to be proactive and use a program like phpMyAdmin to remove these from the database instead:

  • Check your config.php file to make sure you have the correct table prefix. In the example below, phpbb_ is assumed for the table prefix.
  • Open a database manipulation program, typically phpMyAdmin
  • Make sure you have selected the correct database. The config.php file will indicate the database name.
  • If you are using phpMyAdmin, select the SQL tab
  • Execute the following SQL, changing the table prefix if necessary: DELETE FROM phpbb_modules WHERE module_langname LIKE '%DIGEST%'
  • In phpBB, purge the cache in the Administration Control Panel

How to rehost your forum

It can be hard to break up with your web host, particularly if you have phpBB on it. phpBB consists of files plus a database, and the database is stored separately. phpBB does have a knowledge base article on rehosting. You may want to refer to it. In this post I add my own thoughts and document my own processes, since I do a lot of this for a living.

Ask your new host to do it

Some hosts will move your forum along with your whole website for free for you to get your business. If they don’t, you might ask them if they will. This is a great way to go, providing they do it properly. Some hosts will move the files and forget the database, or leave that part for you. Some will do both but won’t integrate the two by fixing phpBB’s config.php file. There are sometimes other issues. File and directory permissions may change moving to a new host, that might cause issues. Of course you can always hire me to do it for you.

The process

The general steps are:

  1. Buy and setup new hosting
  2. Disable the forum
  3. Download a copy of the forum’s database
  4. Download a copy of the forum’s files
  5. Optional: change your hosts file so you can access your domain on the new host
  6. Upload your files to the new host
  7. Recreate the database
  8. Reconfigure the config.php file
  9. Test
  10. Recreate any email addresses
  11. Change the domain to point to the new host
  12. Monitor and fix settings as needed

Buy and setup new hosting

You have probably done this already. I have recommendations on my rehosting page for new hosts if you are still shopping. In some ways figuring out who deserves your business is the hardest part because the new host must be able to handle your forum’s traffic without breaking a sweat, including during spikes of traffic.

After paying for the hosting, make sure you can access it. Typically the host will provide access credentials to a web host control panel, usually cPanel or Plesk. Test your access. You need to do three things:

  1. You need to know the name of the nameservers to use. You will need this for the final step. There should be two of them, and they usually start with “ns”. They are often in an introductory email you get when you pay for hosting.
  2. Create FTP credentials. Often these are created for you, in which case make sure they work by testing them with your FTP program. Because your domain has not moved yet, you usually access FTP using an IP address.
  3. Make sure you can create a database. Look in the web host control panel for database options. In cPanel look for a “MySQL databases” option.

Disable the forum

For consistency you should disable your forum (ACP > General > Board settings) before backing up anything. You might want to first send out a mass email or post announcements indicating that the forum is being moved, so your users aren’t alarmed.

Download a copy of the forum’s database

Use a phpBB database backup

phpBB has a database backup program built into it. You can often backup your database successfully this way with this option. ACP > Maintenance > Database > Backup. For action, select Download. Press Select All to ensure all the tables in your database are backed up. When you submit the form your browser should soon note a file being downloaded.

Use a backup generated by phpMyAdmin

In your web host control panel, phpMyAdmin should be available. You can use it to export your database. Again, you want to download the result. Check the first link to see how this is done. If you are not using MySQL or MariaDB, consult your database tool to figure out how to get an appropriate backup. I recommend downloading the database as a .sql.gz file.

Backup your database from the command line

In some unusual circumstances you may need command line (SSH) access to backup the database. In addition to SSH credentials, you will need credentials to login to mysql from the command prompt. Describing this procedure is too lengthy for this post, but you can use a search engine to learn how to do this. It is challenging!

Check the integrity of the backup

This step is critical. On some hosts (shared hosting in particular) you may not get a complete backup due to resource limitations. Open the archive using an unarchive tool. Use an editor to view it. Look at the bottom of the file. It should end with the phpbb_zebra table. For MySQL/MariaDB, the last character should be a semicolon(;). If you don’t have a complete backup, you will have to get one. This may require an awkward call to your old web host for help.

Download a copy of the forum’s files

I am assuming that your do not have a larger website to move. When moving a domain you need to move all web accessible files for the domain. If you have WordPress as a front end, you will need to move WordPress too, using a procedure similar to the one for phpBB.

You can use your FTP program to download your files. This approach is often very time consuming, particularly if you have lots of files in the forum’s files folder or you need to move an entire website. For phpBB only, make sure you only download the folder containing your forum.

A better way is to use your old host’s file manager. Select all the files in the forum’s folder, or for an entire site select all the files in the web root folder. Click on the first file, scroll to the bottom then while holding the shift key click the last file. This should get all files and folders. Look for a compress option. It will create a .zip or .tar.gz file. Once the archive is generated, download it with your FTP program.

Optional: change your hosts file so you can access your domain on the new host

While this is optional, it’s almost required as it makes the rest of the work so much easier. You want your computer to use your new domain name transparently even though you have not pointed your domain to your new host yet. Instructions for Windows are here, instructions for Mac are here. You need the IP of your new host to make this trick work. When done when you use your domain name in the browser it should see your new hosting. In most cases you will see a default web page for the domain.

Upload your files to the new host

  1. Create the directory for your forum. It should be named the same as on your old host. Where to place it? It must be in a web accessible directory for your domain. Your web folder will vary but it’s usually in a html or public_html folder.
  2. Upload your files. If you have an archive, simply upload that to your forum’s folder, otherwise upload the thousands of files that comprise the software and data for your forum. If uploading an archive, use the file manager on the new host to unarchive it.
  3. Double check that the files uploaded are in the correct folder and that nothing is missing. You can delete the archive file now if you want.
  4. Check your file permissions. On Unix-based systems the following folders need to be world-writeable (777 permissions): cache, files, store and images/avatars/upload. Fix if necessary. All other files should have Unix 755 permissions.

Recreate the database

  1. In your web host control panel, create a new database for your forum. Sometimes you can specify the database name, sometimes you can only specify part of the database name. Write the name of the new database down.
  2. Next, create a database user that will be allowed to access the database. You also have to assign a password to the database user. Make it a complex password and write it and the database user name down.
  3. Give the new database user permissions to the database. Make sure you grant ALL permissions.
  4. Determine the name of the database server. It is usually on the same machine as your web server and can be referenced as localhost. But if it’s something different, write it down.
  5. Try importing the database using phpMyAdmin (for MariaDB or MySQL). Select the import tab for your database. Point it to your database extract and let it be uploaded. Once uploaded it should be read, recreating your forum’s tables. If the file is too big to be uploaded, you got to be more creative. In most cases you need a staggered importer, which generally means uploading and configuring bigdump.php. If the database was partially loaded, make sure you drop all tables in your new database first using phpMyAdmin. bigdump.php must be edited with the correct database settings before being run. Upload the database extract archive to the same folder as bigdump.php. Run bigdump.php by specifying the correct URL based on where you uploaded it. If you didn’t change your hosts file, you will need the IP of your new server. In addition, you may have to specify a folder in the URL after the IP. Often the letter you get with new hosting will contain this information, otherwise ask you new web host.
  6. Check that everything is moved. You should use phpMyAdmin on your new host in one tab, and phpMyAdmin on your old host in another tab. Make sure all tables in the old database are in the new database and that each table in the new database contains the same number of rows as in the old database. Check a few tables to make sure the structure of the table looks reasonable. In most cases there should be a primary key and one or more indexes for a table.

Reconfigure the config.php file

Most likely the config.php file you copied over won’t work as is. Most likely the database name, the database user name and the database password are all different. You can usually edit this file with your web host’s file manager. Bonus tip: if you are running PHP 7.0 or higher, you may need to change the line:

$dbms = 'mysql';

to:

$dbms = 'mysqli';

Test

Hold your breath. Using your browser, enter the URL for your forum and hope it comes up. There may be a delay of several seconds as new cache files are recreated. Fix any errors you find, which can be challenging. Your web host can help or you can hire me. Reenable the forum and test it. Make sure your style looks right, your logo is properly placed, all the forums are on the index and you can make a test post successfully.

Recreate any email addresses

When you move your domain, you should also recreate any email mailboxes and email forwards you set up for the domain. Unless email for the domain is hosted elsewhere, you should recreate these email boxes, such as your board contact email address. If you had any email forwarders, set these up too.

Change the domain to point to the new host

You are ready to go live! Go to your domain registrar. Enter the new nameservers carefully in the appropriate fields for the domain. Then wait for the DNS changes to propagate. These days most changes happen in 1-3 hours. Your users will know they hit the live forum because the forum is disabled message will not appear. Also, if you changed your host file, undo those changes.

Monitor and fix settings as needed

There are often minor hiccups in the software on a new host. Sometimes you may have to upgrade or downgrade the version of PHP used. There may be some PHP settings that have to be tweaked. Expect a few of these and you may need some help from your web host. Things generally settle down within a few days.

March 2018 work summary

What a busy month during March! The first week was a bit slow but pretty much the rest of March I was busy serving clients, many of them commercial clients, which likely made it a record month for work billed, not all of which has been paid yet. A summary of the work is below. As always, who I did the work for has been kept anonymous.

  • Upgraded a forum from phpBB 3.0.14 to 3.2.2. After the upgrade, I could not show the index until I increased PHP’s max_execution_time by editing the forum’s .htaccess file. Installing my digests extension did not work, perhaps due to issues with bringing over data from the digests mod that was installed. Importing digests from phpBB 3.0 has been pretty extensively tested, so I’m not sure what the issue was. I ended up going into the database and correcting various tables and effectively installing and enabling it that way. I recommended installing reCaptcha as a spambot countermeasure.
  • A client was having trouble with WordPress shopping cart tied to PayPal. An email notification by the shopping cart was getting forwarded to a bunch of email addresses. Apparently the email address was set to forward all email it got to a number of other address. Changing the forwarder fixed the problem.
  • Updated a forum from phpBB 3.2.1 to 3.2.2. Uploaded a freshened prosilver_se style and Danish and German casual honorifics language packs. Updated Tapatalk plugin to version 2.0.7. Reapplying style changes required changes to both prosilver and prosilver_se. Later, I fixed an issue of an inability to attach pictures to posts by simply purging cache. Later, I configured the reCaptcha spambot countermeasure due to bounced emails being received. I suggested changing the user registration settings to user activation by email.
  • First I did some troubleshooting. A phpBB 3.0.8 forum could not display certain pages because PHP Notices kept coming up. Trying to edit these out with error_reporting statements did not work for some reason. There were some odd issues with the host too, such as it would not report which version of PHP was installed. Client eventually authorized an upgrade. The FTP credentials provided did not work, so I ended up creating two FTP accounts until one of them worked. This allowed me to upload a new version of phpBB. The upgrade succeeded after fixing an issue in the database of no active style. The preferred AcidTech style did not work with the large rotating images the client wanted places. So I tried a couple of other styles. We settled on a black/green ne-blackgreen style. I had to integrate client’s in-house ad rotatator program so a number of images would rotate in the header. I made some style changes, mostly to remove gradient images that were messing up the placement of the navigation bar. I added the Advertisement Management extension. I placed a PayPal donate button at the top. Integrating a Google Adsense ad did not work. I used the old code but think it’s too old as it was used inside a table. I did some extra work to put two other ads next to each other with different sizes. Changed max-width of the content area from 900 pixels to 90%. Later, I installed Tapatalk extension version 2.0.7.
  • Client moved the database and files for his forum to a new host, just needed me to finish up the work. I could not connect to the forum after changing the config.php file to point to the new database. This was because PHP 7 was being used and phpBB 3.1 uses mysql_connect, which does not exist in PHP 7. No matter. Uploaded phpBB 3.2.2 and the database update worked fine. I replaced the logo. I removed dead ACP modules. Later, I discovered I apparently I upgraded the wrong database (an older version of the forum), so changed config.php to point to the correct database and upgraded that with no issues.
  • Troubleshooting on a phpBB 3.0 forum. Database exceeded it’s quota of 1GB. The issue was a tapatalk_push_data table, which had 779MB of data in it. I truncated the table. I recommended updating the mod as it seems to be a bug or moving to phpBB 3.2 or rehosting.
  • Clicking on some thumbnails did not bring up the larger image. It appears there were some lost images due to a RAID failure in 2016. Some files in the files folder showed 0 byte length. Some files did not exist. I could not find a backup of these images. So I wrote a script to sort of fix the issue by making the thumbnails the actual photo: changing the filesize attribute in the attachment table to the thumbnail’s size and making the thumbnail column 0. In 88 cases the thumbnail files did not exist either. Provided client with a screen capture of all these abnormalities so he can decide if he wants to delete or edit these posts.
  • In part one of a two part job, I upgraded forum from phpBB 3.0.4 to 3.2.2. Since the forum was integrated into a larger commercial site, I did an extensive analysis of what would be lost with an upgrade. There were many code insertions into phpBB to do some things unique to the business. With the new architecture, this should not be done, but there were no extensions to do the previous functionality. Much of it revolved around a “Get a quote” service. The best i could suggest was to allow these installers to have standard signature lines that would embed this information and link to their referral program. Once we agreed on all the workarounds, I started off with upgrading the less trafficked site as the first test. I applied the AllanSubsilver style. I made some CSS and template changes to accommodate site heading and Google site search, changed some colors, changed some container widths, and address some font issues. I installed and configured the Google Analytics extension. I installed the Advertisement Management extension but did not add any ads at this time. I demonstrated the Get a Quote feature in a signature line. I removed contact information from view topic screen by hiding it. I did various other tweaks. I added the announcement on index extension. I configured reCaptcha and removed thousands of bogus registration and spam posts that quickly accumulated when the forum went live. I suggested they might want to use Cleantalk extension and service. Later I addressed a reCaptcha issue of the CAPTCHA image not showing upping PHP from 5.4 to 5.6. It turned out though that there was some other PHP software on the site that could not use PHP 5.4. PHP was reverted to 5.4. I found a setting in Plesk to set allow_url_fopen to on and the issue went away. More than a week later, I did part two (second domain). A lot of the work was the same as the first part, so it went somewhat faster since I knew what the issues were. Header was different with dynamic content scripts I could not integrate, so I copied/pasted the resulting code. Installed same extensions. Configured reCaptcha. Hid logo block entirely since that was the way it was on the old forum. Did not put fuzzy image along borders of main content area to match what was there before. Changed PHP to allow it to open external links. Changed script for main site to not retrieve a block of recent topics since the database schema had major differences. Likely more tweaks to come in April to close off this project.
  • I upgraded a forum from phpBB 3.1.10 to 3.2.2. Client has a ton of extensions. He decided to upgrade those himself and just have me do the upgrade. The style for Platinum for phpBB 3.2 was not official and I found issues when I installed it. For example, navbar.html did not have logoff and other links! So copied and pasted the version from prosilver and used that and it worked with the old style.
  • I finished an update/upgrade the client started but failed. I could not login to forum with credentials given. I could not use FTP with credentials given either, but was able to create some in cPanel. I tried a few obvious things to get the upgrade/update to finish that did not work. I ended up copying up the entire 3.2.2 source code and it was able to finish the upgrade/update. I placed the logo image using the File Manager editor in cPanel.
  • New install of phpBB on a test server that would eventually be migrated to a production domain. Client wanted to imitate the forum at another website and wanted it put together on the test domain. Some wasted time because I thought he wanted me to imitate his existing website. Most of the work was trying to make the styling acceptable. Client selected the AllenSUBSILVER style. I installed the Advertisement Management extension and placed a sample ad. I installed Pages extension because client wants a bunch of static pages like Contact, Ads, etc. They have placeholder text. Styling was challenging because I decided to use the navigation bar for his other pages and I had to make it red, but doing this made a lot of text and icons impossible to see. So I had to change CSS for submenus so the desired look was accomplished. 90 minutes of tutoring online followed some days later.
  • After an upgrade I did in February there were dead extensions showing on the Customise tab, extensions that worked in phpBB 3.1 but were not available for 3.2. I fixed the by deleting these rows in the phpbb_ext table using phpMyAdmin. Client asked if there were ways to improve performance. I suggested upgrading PHP to 7.2.
  • More work for a client I helped in February. He had weird database permissions issues which caused certain extensions not to install. He moved the forum to a different server, and that seems to have solved previous database permissions issues. Basically the people on this site like lots of features, and wanted me to install a boatload of extensions, many of which were problematic because they were in development, beta, etc. After being assured that I would be paid for extensions I installed that might not work on phpBB 3.2, I ended up installing a total of twelve extensions, some of which as I expected had issues and were subsequently disabled.
  • Upgraded a forum from phpBB 3.0.10 to 3.3.2. Installed Revolution style but tweaked it quite a bit. Background color changed from black to white. Increased minimum widths for content area. Reduced vertical space for logo and content area as it was too generous. Styled the search box to make it look similar to other content areas. Installed reCaptcha V2 as spambot countermeasure.

Site cleanup

I’ve spent the last two days cleaning up the website. Some pages were removed. My services page was broken down into a number of pages for easier reading. I changed some page titles and edited one form. I also updated the theme. Hopefully the site is cleaner, less cluttered and easier to use.

February 2018 work summary

The nature of my business seems to be that it the work is few and far between or it all comes in at once. The first half of the month was mostly quiet. The second half was mostly busy … too busy. Anyhow, here’s a summary of my work in February. As always, I am not identifying my clients:

  • A lot of work here for one client. Basically, the client wanted a whole lot of changes to his forum. The endeavor was sort of successful.
    • I installed a development radio extension. This puts a player on the screen that plays music from a playlist for all members on the forum. I had to tweak the composer.json file to get it to install. To get the radio player images to appear on the portal, I had to hack one of the programs for the extension to use an image path that starts with / or they would not appear on the portal.
    • I tried to install Tapatalk a number of times but to no avail. I kept getting an installer error creating the Tapatalk tables. Upgrading phpBB didn’t work. So I tried installing an earlier version of Tapatalk. That didn’t install either. Since the issue was with the Tapatalk table not being created, I installed Tapatalk on a test environment, got the needed SQL there using phpMyAdmin and recreated it manually on the client’s site in phpMyAdmin. I changed the phpbb_ext table to make it active and cleared the cache. I could then see it in the Extensions tab and could enter the key.
    • Created an Apache redirect so non-www URLs went to www instead. Lines were added to .htaccess file.
    • Changed the color of the text in mChat when editing chat text. It was white on white, made it black on white.
    • Added a favicon for the site
    • Installed an extension to open external links in new tabs
    • Installed the Profile Flair extension. This allows badges to be created.
    • Installed the YouTube Video Gallery extension. It requires creating an application in Google console to enable, which the client did.
    • Updated phpBB 3.2.1 to 3.2.2. Applied three manual changes afterward, bugs that were subsequently found in the release.
    • Edited some colors on the portal sidebar that kept text from being seen.
    • Fixed a resizing issue with embedded videos on mobile devices by adding max-width:100% and max-width:100% CSS directives for the object tag.
    • Made more tweaks to colors for the “time” line near the navigation bar, made better CSS selectors for poll links in the portal and moved vote buttons in the portal more to the right, along with vote totals.
    • Radio extension turned out not to be viable. So I disabled it. I tried to place the player manually. I tried a number of approaches, once I figured out how to write the Javascript correctly. The easiest way was to turn it into an ad in the Advertisement Management extension and place it above the navigation bar.
    • More trouble with Tapatalk when the client tried to add a permanent Tapatalk key. Again the extension failed in an ugly manner and again the issue was some sort of database privilege that should have been there was not, probably for creating new objects like tables, columns and indexes. I commented out some code in the extension to get it to come up so the board was usable, but feels jury rigged. Installed some smilies that client needs to configure. The client is getting with his web host to try to solve the underlying issues of database privileges needed to create new tables that seems to be the issue with Tapatalk.
  • I upgraded forum from phpBB 3.0.10 to 3.2.2. I applied patches to 3.2.2 after the upgrade. There were two issues during the upgrade. The first (duplicate row in config table) went away by running the upgrade again. The second required using phpMyAdmin to edit the prosilver style and make it active. Then the upgraded completed. I removed some dead modules carried over from phpBB 3.0. I created keys on reCaptcha site and entered them into reCaptcha spambot settings, but they were not recognized. I eventually discovered if I requested invisible reCaptcha those keys would work. There was a similar issue with a Cleantalk authorization key. The client had to generate a key on Cleantalk site and he installed it himself. I also installed the Advanced BBCode extension. I noted an email error I encountered with the upgrade. It may be an issue with integration with email. Later that day when the client removed my FTP account (since it gave access to the web root) it also removed everything in the public_html folder! So his whole web site including the forum was gone! The web host had to recover it. The next day I reapplied the file changes for the upgrade and uploaded the programs for the extensions that were installed. The database was still good so I didn’t need to run the upgrade program again. The client asked me to look into errors in some 3rd party software tied to phpBB in his members folder. It asked for PHP 5.4. I changed his .htaccess file but that exposed an issue that the code was using super globals, so it didn’t work. I suggested contacting the original author and having him update the program to use the new phpBB 3.2 libraries. Client eventually figured it out himself.
  • Lots of work for this client too:
    • I converted a forum from phpBB 2.0.23 to 3.2.2. About 200,000 posts with about 7000 attachments. The conversion went smoothly. Allen Subsilver style installed. I replaced the logo. I recreated search index. I moved the old forum into old_forum folder where it exists as an archive.
    • Later I installed a Board Rules extension and Custom Registration Agreement extension.
    • Customer discovered a weird problem. When using the search index, sometimes a XML parsing error occurred. After lots of puzzling it through I realized I had seen this before. Non UTF-8 characters (probably belonging to the Windows character set) were in post_text column and other columns. The parser could not parse these characters because they were not translatable into UTF-8. I fixed it with SQL using MySQL CAST and CONVERT functions on all columns in tables where users type in text.
  • Removed and re-place some ads in overall_header.html for a phpBB 3.0 forum
  • I got called in as a consultant for a huge forum, the biggest I’ve ever seen: 14M posts! That’s about 4 times as many posts as are on phpbb.com’s forums which have been running since 2001! What a strange issue they were having! For about 48 hours they could operate as normal, then the database would freeze updating num_posts in the phpbb_config table. All they could do is recover the database and start again, then 48 hours later it would happen again. They were very frustrated. The error message suggested that some transaction was not getting completed. In addition, the value for num_posts in the phpbb_config was not consistent with the actual number of posts. On top of all this, this phpBB 3.0 forum has a site Wiki outside of phpBB, and the Wiki made posts to their forum using a MySQL stored procedure. What to do? It took hours to get command line access just so I could look around. Once inside MySQL I looked at the tables. Most were using the MyISAM storage engine, but the phpbb_config table where the problem was happening was using the InnoDB storage engine. If I changed its storage engine to MyISAM, would the problem go away? I did and the problem went away! Oh, I also wrote some SQL so num_posts matched the actual number of posts in the phpbb_posts table.
  • Upgraded a forum from phpBB 3.2.1 to 3.2.2. No surprises.
  • Updated a forum from phpBB 3.2.0 to 3.2.2. A direct 3.2.0 to 3.2.2 update would not work and caused Symfony errors. After much trial and error an upgrade to 3.2.1 then to 3.2.2 worked. I reapplied the logo and styles. I was asked to set permissions so users could edit their own posts and to fix an issue with their posts not going through moderation. It took some puzzling to figure this out. Apparently when a new user registers, they are placed in both the Newly Registered Users group and the Registered Users group. Unless permissions for Newly Registered Users are set to Never the privileges for Registered Users, if more generous, will take precedence. So for Newly Registered Users, I added Never permissions for seeing forums they weren’t supposed to see. Although newly registered users were required to have one post before they were considered registered users, posts are only moderated if the moderation permission is enabled, which it was not. So I turned on these permissions for this group.