Avatar

A request to the audience and especially to forum owners (Development)

by Auge ⌂, Sunday, March 10, 2024, 21:24 (47 days ago)

Hello

When we released the first versions of the 2.5-branch (beginning with version 20220508.1) I wrote the upgrade script and made a few mistakes, that can lead to a broken installation. Because of that and because I had lost track of it all I completely rewrote the upgrade script and wrote a complete set of instructions for every version group from one can start an upgrade instead splitting the process into several single steps for every next version like it was done before.

I made several tests myself. Starting from checking for the version of MySQL or MariaDB that is required to run the forum in the new versions over checking for E-mail addresses used in multiple user accounts and stopping the upgrade process if one of the requirements is not fulfilled to changing the database engine type of the tables to InnoDB in a loop (no change if the tables are already defined in the engine type InnoDB) I performed many single unit tests (testing only one function/step at once).

I also performed upgrades from several versions to the current stand. Starting versions was version 2.4.24 (as example for all supported stable versions of the 2.4-branch), version 2.4.99.1 and 2.4.99.3 as examples for the testing versions and versions 20220508.1 and 202205017.1 as stable versions of the 2.5-branch with different states of their database structure when a forum was installed or upgrades with the upgrade script as it was before.

Now I am at a point, where I need input from outside. I want to prevent to introduce new pitfalls and bugs to the upgrade process. Because of this I want to encourage people who are able to read PHP and SQL soucecode and who have a Github account to inspect the code of the PR (pull request) and to ask questions, to follow my thoughts and mention possible errors in code and thoughts.

I am also interested in upgrade tests of forum owners/operators with copies of their running forums. One can upgrade from one of the following versions.

- 2.4.19 (new, was not possible before)
- 2.4.19.1
- 2.4.20
- 2.4.21
- 2.4.22
- 2.4.23
- 2.4.24
- 2.4.99.1
- 2.4.99.3
- 20220508.1
- 20220509.1
- 20220517.1
- 20220529.1
- 20220803.1 (upgrade possible with the further changes made 2024-03-11)

The not mentioned testing versions 2.4.99.0 and 2.4.99.2 was never released to the public. Noone except me could have access to these versions. ;-)

[delete]It is also important to know that version 20220803.1 is not yet among those for which an upgrade is possible.[/delete]

The previous paragraph is outdated. With the changes, made to the code of the pull request on 2024-03-11 an upgrade from version 20220803.1 to the current development stand is in fact possible.

To do this upgrade one needs …

1. … access to a tool like phpMyAdmin, the MySQL Work Bench or similar tools to perform operations in and to create copies of the tables of the running forum (in example by copying all tables of the running forum from mlf2_table_name i.e. to mlf3_table_name, …

2. … to put a copy of the script files of the current forum to a new directory, …

3. … to adapt the table names in the file config/db_settings.php of the copied forum to the names of the new, copied tables …

4. … and to change the following settings in the table mlf3_settings

- forum_address to the URL with the new directory
- forum_name to distinguish it from the always running forum
- session_prefix to a different value than the one of the running instance (one will need to login again) to prevent a mixup of the user session of the administrator account

As last step of the preparations please download the branch with the fixed upgrade script from my fork of My Little Forum. Open the submenu for downloading with the button named "<> Code" (marked with 1 in the screenshot) and download the ZIP from the bottom of the overlay (marked with 2 in the screenshot).

[image]

After unzipping load up the files config/VERSION and the upgrade script update/update_2.4.19-2.5.php itself to the copy of the forum. Go to the admin area of the forum copy and run the upgrade with the offered script update_2.4.19-2.5.php. There might be further upgrade scripts depending of the current version of your forum (update_2.3.5-2.4.php or update_2.4.19.1-2.5.php). Make sure to use the correct script update_2.4.19-2.5.php for the upgrade. After performing the database changes in the first step load up the files, that are mentioned to be updated (and deleted) to have a working upgraded copy without a bunch of error messages on every page. You'll end up with the version 20240308.1 which is not an official release. This version includes a few changes that was made after the release of the version 20220803.1 but not a single one of the much discussed database performance fixes. The only fix is the one for the size of the column for storing IPs because this bug can lead to server errors.

As last go the the advanded settings page and change the following settings.

- delete_inactive_users = 0
- notify_inactive_users = 0

The two settings, set to value 0, prevents the notification of inactive users about the possible deletion of their accounts and the deletion in itself. That would be bad in the copy of the real forum. In the real forum it could be a judical necessity (i.e. in the EU).

Normally one has also to set the setting (forum_enabled) to the value 1. This would reactivate a forum after the upgrade but is not necessary in the case of an upgrade test in a copy of a real forum.

After performing the upgrade I would like to see the table definitions of the upgraded forum. Please perform an export with phpMyAdmin, MySQL WorkBench or a similar tool you used for the first step of the preparations. The export is done in phpMyAdmin in the database view (do not open it in the view of a single table, this would lead to unnecessary additional work) in the Export tab. Activate the option "Customised - display all possible options" (I translated it from german, I don't know th original option text). You'll see a table with the names of all database tables with checkboxes for structure and data. We need only the structure of the upgraded tables (table names beginning with the prefix mlf3_ (using my example names from above)). Activate the option "Show output as text" in the section Output. As last click the export button. Copy the result and insert it here in a new reply to this posting together with the information about the version from where you started the upgrade.

At that point one can delete the forum copy and also delete the corresponding copies of the forums database tables.

Very long story very short, the complete rewrite consists of over sixty individual changes and I need support for this really big task to prevent the introduction of new bugs while solving old ones.

Thank you in advance. If you have any questions about the tasks to do please ask here before you begin.

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

Tags:
development, testing


Complete thread:

 RSS Feed of thread