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.