Actions

Mediawiki 1.43 from 1.39: Difference between revisions

From Rabbi Blog

mNo edit summary
Line 25: Line 25:


==Mediawiki==
==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)
# 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 script directory
 
## Comment out all of the extensions
 
## Set the skin to one that comes stock
 
# 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
 
 
 
 


==Requirements==
==Requirements==

Revision as of 18:24, 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

  1. Create the databases with the wiki version in the name. End it with _139 or something.
  2. Create the site directories in the same fashion. Use symlinks for the actual "public" name.
    1. 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

  1. 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
  2. BACK THINGS UP
  3. List your extensions (go to the Special:Version page, copy that page out to a Google Sheet so the links are intact)
  4. Create a new database_### and import the previous version db into that
  5. Create a new html dir mediawiki_### and import the target mediawiki into that
  6. Copy LocalSettings.php into the new dir from the old dir
  7. Edit LocalSettings.php
    1. Update the script directory
    2. Comment out all of the extensions
    3. Set the skin to one that comes stock
  8. run php maintenance\update.php from the command line
  9. Copy the images/ directory from the old install
  10. Update file permissions as needed during testing
  11. 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
  12. Work through the skins

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

  1. copy the existing db into a new db_1.43
  2. set permissions

Mediawiki Files

  1. Make a list of the extensions...
  2. sudo mkdir it-wiki-1.43
  3. chown it:www-data it-wiki-1.43
  4. upload new files to 1.43
  5. cp /var/www/html/wiki-1.39/LocalSettings.php /var/www/html/wiki-1.43
  6. cp -r /var/www/html/wiki-1.39/images/ /var/www/html/wiki-1.43/
  7. 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
  8. edit LocalSettings.php to reflect url path for testing
  9. $wgScriptPath
  10. $wgServer
  11. change the db to 143
  12. set the skin to vector (shut off foreground)
  13. disable extensions
  14. Test
  15. sort out extensions and cleanup LocalSettings.php

Changeover

After testing...

  1. Set the symlink to the new dir
  2. $wgScriptPath
  3. $wgServer



The Approach

  • ALL THIS STUFF IS FROM THE LAST PAGE, REVAMP IT!


Prepping the Databases

  1. Backup the MW databases
  2. Find my Google sheet with notes
  3. 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
  4. Upgrade MySQL
  5. 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.