Mediawiki 1.43 from 1.39: Difference between revisions
From Rabbi Blog
| Line 53: | Line 53: | ||
* Set up your backups if exporting the db and backing up the html directories. | * Set up your backups if exporting the db and backing up the html directories. | ||
=OLD NOTES BELOW= | |||
==Requirements== | ==Requirements== | ||
Required software as of MediaWiki 1.47.0: | Required software as of MediaWiki 1.47.0: | ||
Revision as of 18:36, 15 August 2026
Background
This was a WhatIf page to map out 1.39 to 1.43 with a thought of waiting until November for 1.47 LTS... but I went for it this past week.
LTS
Note: 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 |
The Process
The last few times I've done this I have been honing in on 'what is the basic approach to updating Mediawiki?' and I think I'm there now.
Naming
- Create the databases with the wiki version in the name. End it with _139 or something.
- Create the site directories in the same fashion. Use symlinks for the actual "public" name.
- example: rabbibob\->rabbibob_139\
- example: rabbibob\->rabbibob_139\
I started doing this so updates were more agile. When I want to go to 143, I can create rabbibob_143\ and use that as a fresh area to configure, then shift the symlink when it is all done. Copying the db from the _139 into a new _143 is the other key. Editing LocalSettings.php allows for the ability to do this. The limitation is if php or mysql requirements don't allow to the older or the new version to cohabitate.
Mediawiki
- Know the requirements for where you are and where you need to get to in regards to MySQL and PHP requiremnts.
- Sometimes a major revision upgrade of the OS carries these with them and it might be worth updating the OS or starting a fresh install
- BACK THINGS UP
- List your extensions (go to the Special:Version page, copy that page out to a Google Sheet so the links are intact)
- Create a new database_### and import the previous version db into that
- Create a new html dir mediawiki_### and import the target mediawiki into that
- Copy LocalSettings.php into the new dir from the old dir
- Edit LocalSettings.php
- Update the following with temporary values
- $wgScriptPath
- $wgServer
- Comment out all of the extensions
- Set the skin to one that comes stock
- Update the following with temporary values
- run php maintenance\update.php from the command line
- Copy the images/ directory from the old install
- Update file permissions as needed during testing
- Work through the extensions
- It is worth curating the extensions so you know what is custom and came with the new update
- Comment out any that you are not using
- Add ## or #! for ones that crash MW
- Work through the skins
- When everything is working, set the symlink to the new dir
- Edit LocalSettings.php
- $wgScriptPath
- $wgServer
Clean Up Thoughts
- Set up your backups if exporting the db and backing up the html directories.
OLD NOTES BELOW
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.