phpBB3 SSH Upgrade Tutorial

How to upgrade phpBB3 through SSH

There are a few ways to upgrade your phpBB3 forum. If you want to keep all the modifications you've made, you have the choice to upgrade your phpBB3 through the administration panel of your site using an automatic update package, or through SSH using a patch file. To learn how to perform the update using an automatic update package, check out the tutorial on upgrading phpBB3 using the automatic updater.

In this tutorial we'll show you how to perform the upgrade through SSH. All HostKnox clients have free SSH access to their hosting accounts.

Before you begin the upgrade process make sure you have a recent backup of the phpBB3 files on your account and of the database used by your phpBB3 application.

The first thing you have to do is to go to the download section of the official phpBB3 site and download the patch files archive. It contains several patch files corresponding to different phpBB3 versions. You need only one patch file that you will use to upgrade your current version to the last stable phpBB3 version (e.g. phpBB-3.0.8_to_3.0.9.patch). The archive also contains two folders: docs and install. You will also need the install folder for the upgrade.

After you download the archive you have to unpack it on your local computer and then upload the install folder and the corresponding patch file to the root phpBB3 directory on your hosting account (e.g. public_html/phpbb3) with an FTP client or through SSH. Alternatively, you can also upload the archive directly to the root phpBB3 directory on your hosting account and then unpack it through the Files section of the Pixie control panel or through SSH.

Once you have the patch file and the install folder in the root phpBB3 directory on your account, you can begin the upgrade process. First, you need to log in to your account through SSH. By default you'll be logged in the directory /home/username (where username is replaced by your actual username). In this tutorial we'll assume that your phpBB3 application is installed in a folder called phpbb3 in the public_html directory on your account, which means that the path to it would be /home/username/public_html/phpbb3.

The command that you have to execute to upgrade your application looks like this:

patch -cl -d <path to phpbb3 directory> -p1 < <path to patch file>

You have to replace <path to phpbb3 directory> and <path to patch file> with the actual paths.

So, assuming your phpBB3 is installed in /home/username/public_html/phpbb3, you're updating from version 3.0.8 to 3.0.9, and you haven't changed your default current directory (/home/username) after logging in to your account, the command would look like this:

patch -cl -d public_html/phpbb3 -p1 < public_html/phpbb3/phpBB-3.0.8_to_3.0.9.patch

If you have changed the current working directory on your account, you only need to change the paths in the command to the phpBB3 directory and to the patch file inside it. You can also use the command cd to change the current working directory (e.g. cd /home/username), and the command pwd to see the current working directory.

You can also replace the relative paths with absolute ones, e.g. instead of public_html/phpbb3 you can type /home/username/public_html/phpbb3, then the current working directory in which you execute the command will not matter.

After you execute the command, if everything goes smoothly and you don't receive any error messages, the update process will be over in a second and you'll see a list of the updated files.

The last thing you have to do to complete the update is to update the database tables used by your phpBB3 application. You can do this by opening with your internet browser the URL address of the database_update.php file that's inside the install folder you uploaded earlier, before starting the upgrade. So, if your phpBB3 site is installed in a folder called phpbb3 in the root public_html directory of your account, the URL address should look like this:

After the database is updated you can delete the install folder and the patch file from the root phpBB3 directory on your account.