Updating phpBB 3.1.x to phpBB 3.2.x

On the test, I will update the phpBB 3.1.9 forum to the version of phpBB 3.2.2.

System requirements phpBB 3.2 if necessary, you can see here https://www.phpbb.com/support/docs/en/3.2/ug/

Be sure to make a backup copy of the database and forum files.

I recommend that you perform an update on the test virtual server, running a copy of the forum from the backups, because in my case there were errors and it took them a while to fix them, and then you can update them to the main one in a similar way quickly.

We proceed to update, download the archive with the new version of phpBB 3.2.x and unpack it:

wget https://www.phpbb.com/files/release/phpBB-3.2.2.zip
unzip phpBB-3.2.2.zip

In the unpacked forum data, delete the file config.php and these directories: files/, images/, store/.

In the phpBB data, what’s on the web server will be deleted except for the ext/, files/, images/, store/ and config.php file.

Move the remaining downloaded data to the directory with the forum data, agree to overwrite the file in the ext/ directory.

If the rights to files and owner change, for example, you can specify them as follows:

sudo chown -R www-data:www-data /var/www/forum/

If the database of the forum is large, then you can execute the command in the root directory of the forum:

php ./bin/phpbbcli.php db:migrate --safe-mode

Open the forum address in the browser by adding /install/app.php/update or /install/database_update.php at the end, select the “Update” tab, select “Update database only”, start the update process and wait for the completion.

After the successful update, delete the install directory:

rm install

See also my articles:
Solution of error “A module already exists” and “The installer detected a timeout” when updating phpBB
Import and export MySQL databases
Updating phpBB 3.1.8 to phpBB 3.1.9
Updating phpBB 3.0.x to phpBB 3.1.x
Other about phpBB

Solution of error “A module already exists” and “The installer detected a timeout” when updating phpBB

I updated phpBB 3.1.9 once to phpBB version 3.2.2 and noticed the following error:

The installer detected a timeout
The installer has detected a timeout, you may try to refresh the page, which may lead to data corruption. We suggest that you either increase your timeout settings or try to use the CLI.

Cleaned the table “phpbb_migrations” in the forum database:

TRUNCATE TABLE phpbb_migrations;

And again launched the update, but got another error:

A module already exists: UCP_AUTH_LINK_MANAGE

The standard Profile module was naturally installed, it could be disabled, but not deleted.
Therefore, I found it in the “phpbb_modules” table and deleted it, thus causing the update script to think that it is not installed:

SELECT * FROM `phpbb_modules` WHERE `module_langname` LIKE 'UCP_AUTH_LINK_MANAGE';

After continuing the update noticed another error:

A module already exists: ACP_CONTACT_SETTINGS

The Contact module was not even installed, after that I also found it in the table and deleted it, and also found and deleted “UCP_AUTH_LINK_MANAGE” once again, because the update script restored it:

SELECT * FROM `phpbb_modules` WHERE `module_langname` LIKE 'ACP_CONTACT_SETTINGS';
SELECT * FROM `phpbb_modules` WHERE `module_langname` LIKE 'UCP_AUTH_LINK_MANAGE';

After removing the modules from the “phpbb_modules” table, I cleared the “phpbb_migrations” table:

TRUNCATE TABLE phpbb_migrations;

I launched the phpBB update and it was successful.

See also:
Updating phpBB 3.0.x to phpBB 3.1.x

How to remove statistics from the main page phpBB

To remove statistics from the main page of the phpBB forum, comment out certain lines in the template file of the theme used.
Go to the template folder and open the file index_body.html in a text or html editor.
We find the following lines:

<h3>{L_STATISTICS}</h3>
<p>{TOTAL_POSTS} &bull; {TOTAL_TOPICS} &bull; {TOTAL_USERS} &bull; {NEWEST_USER}</p>

And comment them out:

<!-- <h3>{L_STATISTICS}</h3> -->
<!-- <p>{TOTAL_POSTS} &bull; {TOTAL_TOPICS} &bull; {TOTAL_USERS} &bull; {NEWEST_USER}</p> -->

After the changes in the files, you must clear the cache through the control panel or manually.

The list of users online, the legend of moderators and administrators, birthdays can be disabled in the control panel of the forum: “Home” -> “Server load“.

Updating phpBB 3.1.8 to phpBB 3.1.9

Today has updated the phpBB 3.1.8 forum to phpBB 3.1.9 with the automatic service pack.

Below I will describe the order of actions for the update:

1) Let’s make a backup copy of the files and the forum base.
In Linux, you can do this with commands:

sudo tar -cvjf backup_forum_files.tar.bz2 /var/www/forum/
mysqldump -u USER -h localhost -p BASE | gzip -c > backup_forum_base.sql.gz

2) Now you need to download the archive with the service pack “https://www.phpbb.com/downloads/#update”.

3) Unpack from the archive only install/ and vendor/ in the directory with the forum. If the install folder is located in the directory with the forum, it automatically turns off, that is, no one on it will not write and walk.
If the files were moved from the terminal, then the rights of the owner from which they moved could be set and the web server can not access them, so let’s specify the group and owner from which the web north is working:

sudo chown -R user:user /var/www/forum/install/
sudo chown -R user:user /var/www/forum/vendor/

4) Open the browser link to the forum by adding install to it, for example http://example.com/forum/install/.
Now it’s time to press Update and follow the instructions.

If you made changes in the code of some files and they are affected by the update, you will be informed about this and offered to choose which version of the files to leave, in my opinion it is better to put the new version from the update, and then make the changes after the update by comparing both files for example in Notepad++ with using the plugin Notepad++ Compare plugin which shows the differences in the code of files.