Mediawiki 1.43 from 1.39
From Mike Beane's Blog
Background
This is a WhatIf page to map out 1.39 to 1.43 (and maybe just wait until November for 1.47 LTS)
.
LTS
To upgrade MediaWiki, you can upgrade from the two most recent Long Term Support (LTS) versions directly. If you are using an older version, you must first upgrade to one of the two latest LTS versions before proceeding to the latest version.
The Path
| Version | MySQL | PHP | Jumps | Status | Notes |
|---|---|---|---|---|---|
| MediaWiki 1.39.5 LTS | MySQL 8.0.46 | PHP 8.1.2 | 0 | Current | |
| MediaWiki 1.43 LTS | MySQL 5.7.0+ (good) | PHP 8.1.0+ (good) | 1 | Could do now | |
| MediaWiki 1.47 LTS | MySQL 5.7.0+ (good) | PHP 8.3.0+ (need to update) | 2 |
Requirements
Required software as of MediaWiki 1.47.0:
- Web server with PHP 8.3.0 or higher, plus the following extensions:
- ctype
- dom
- fileinfo
- iconv
- intl
- libxml
- mbstring
- openssl
- xml
- xmlreader
- A SQL server, the following types are supported
- MariaDB 10.11 or higher
- MySQL 5.7.0 or higher
- PostgreSQL 10 or higher
- SQLite 3.31.0 or higher
June Notes
PHP 8.4
- This can be done prior to the major jump as 1.39 supports 8.4
Steps
- dpkg -l | grep php
- sudo apt-get install php8.4
- sudo apt install php8.4-cli php8.4-common php8.4-mysql php8.4-zip php8.4-gd php8.4-mbstring php8.4-curl php8.4-xml php8.4-bcmath
- sudo apt install php8.4-redis php8.4-pcov php8.4-imagick php8.4-intl
- dpkg -l | grep php
- sudo update-alternatives --config php
- php -v
- sudo a2dismod php7.4 9
- sudo a2enmod php8.4
- sudo systemctl restart apache2
- Check wiki version, should be at 8.4.x
MySQL
- copy the existing db into a new db_1.43
- set permissions
Mediawiki Files
- Make a list of the extensions...
- sudo mkdir it-wiki-1.43
- chown it:www-data it-wiki-1.43
- upload new files to 1.43
- cp /var/www/html/wiki-1.39/LocalSettings.php /var/www/html/wiki-1.43
- cp -r /var/www/html/wiki-1.39/images/ /var/www/html/wiki-1.43/
- set permissions
- sudo chown -R it:www-data /var/www/html/wiki-1.43/images
- sudo chmod -R 775 /var/www/html/wiki-1.43/images
- edit LocalSettings.php to reflect url path for testing
- $wgScriptPath
- $wgServer
- change the db to 143
- set the skin to vector (shut off foreground)
- disable extensions
- Test
- sort out extensions and cleanup LocalSettings.php
Changeover
After testing...
- Set the symlink to the new dir
- $wgScriptPath
- $wgServer
The Approach
- ALL THIS STUFF IS FROM THE LAST PAGE, REVAMP IT!
Prepping the Databases
- Backup the MW databases
- Find my Google sheet with notes
- Tally the extensions in use and find out what is still being maintained.
- From the old sites I made copy of the Extensions that were installed via the Special:Version page
- Upgrade MySQL
- Upgrade PHP
- I installed the lowest version of MediaWiki I required and verified it worked.
- I then pulled in a backup of my two wiki sites
- I imported images/ from the same site
- I pointed mediawiki (via localsettings.php) at one of the databases
- Ran maintenance/update.php --force
- Verified that the information loaded in the new site
- NOTE: I entirely ignored Skins and Extensions.
- Repeated for Site #2
- Once I had a working MW site for each database, I installed the next LTS MW version.
- Repeated the above steps
- Once I had a working MW site for each database, I installed the next LTS MW version.
- Repeated the above steps
- Eventually I had two working MW databases at 1.39
New Ubuntu Server
- I created a new Ubuntu 22.04 server and on this one, I took the time to set up various security related items.
- I opted to put
- MySQL at 8.0.35-0ubuntu0.22.04.1
- php at 8.1.2-1ubuntu2.14 (apache2handler)
- Installed apache2, created a new MW1.39LTS site to verify it ran under the new software.
- From there, I imported the two site databases, copied the 1.39 directory to two separate directories, set up MW, imported images and all was good.
Extensions and Skins
- The Skin was freshly installed from the latest version. Not much of an issue there.
- This was a little more tedious: I matched up the default 1.39 extensions against the old site listings and then went looking to for the latest extensions.
- Some extensions were still in production
- Some were not
- Fiddled until things were working. Had to fix some code for YouTube.
Summary
- I tried this about seven months ago and I was attempting to update the extensions as I went: this was not the way to go. Getting the database updated was the key and ignoring everything else made that easier to do. All a wiki really is at the base is the information (database) and the images/... everything else is functionality.