MediaWiki version:
1.19
MediaWiki file: updateCollation.php
Location: maintenance/
Source code: master 1.40.0 1.39.4 1.35.11
Classes: UpdateCollation

Details

This script updates category collations. You need to run this script after $wgCategoryCollation has been changed. It is also needed to be run after upgrading to 1.17 and later from a version of MediaWiki before 1.17. Normally it is run as part of update.php.

If your category collations are messed up (aka things sort incorrectly in categories), you can use the --force switch to forcibly fix all the category collations.

The run time of the script depends on the number of rows in the categorylinks table, and for extremely large wikis may take over 24 hours. (A run on the English Wikipedia in September 2016 took around a week: phab:T136150.) The script can process on the order of 10,000 rows per minute (depending on your setup); you can view the estimated number of rows on your wiki before running the real script by using updateCollation.php --dry-run. Wikimedia wikis of various sizes have been painlessly switched to different collations over time (phab:T47443), just make sure to estimate how long the script will run before you start it.

Options/Arguments

Option Description Required?
--force Run on all rows, even if the collation is supposed to be up-to-date.Optional
--previous-collation Set the previous value of $wgCategoryCollation here to speed up this script, especially if your categorylinks table is large. This will only update rows with that collation, though, so it may miss out-of-date rows with a different, even older collation. Optional
--target-collation Set this to the new collation type to use instead of $wgCategoryCollation. Usually you should not use this, you should just update $wgCategoryCollation in LocalSettings.php. Optional
--target-table Copy rows from categorylinks into the specified table instead of updating them in place.Optional
--remote Use Shellbox to calculate the new sort keys remotely.Optional
--dry-run Don't actually change the collations, just compile statistics.Optional
--verbose-stats Show more statistics.Optional

Usage

php maintenance/updateCollation.php [ --force| --previous-collation| --target-collation| --target-table| --remote| --dry-run| --verbose-stats ]

Dry run to check updates

Terminal
$ php maintenance/updateCollation.php --dry-run

Selecting next 100 rows... processing...0 rows would be updated so far.
Selecting next 100 rows... processing...0 rows would be updated so far.

Updating category collations

Terminal
$ php maintenance/updateCollation.php

Selecting next 100 rows... processing...100 done.
Selecting next 100 rows... processing...143 done.
143 rows processed

See also

  • Categorylinks table
  • Manual:Hooks/GetDefaultSortkey
  • Manual:Hooks/Collation::factory
  • $wgCategoryCollation
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.