Jump to content

Manual:cleanupBlocks.php

From mediawiki.org
MediaWiki version:
1.25

Details

[edit]
MediaWiki version:
1.44

cleanupBlocks.php is a maintenance script that performs various tasks to fix data integrity with the block and block_target tables.

This script includes the following tasks:

  1. Delete any block_target rows that have no corresponding blocks
  2. Delete blocks which have a bl_target pointing to a non-existent bt_id
  3. Fix IP address normalization issues
  4. Merge block_target rows referring to the same user, IP address or range
  5. Find and fix incorrect bt_count values


MediaWiki version:
1.42

The script cleans up user blocks with usernames that do not match the user table. This works in two steps:

  1. Clean up duplicate user blocks.
  2. Update mismatched usernames.

Options/Arguments

[edit]
MediaWiki version:
1.44
--dry-run
Perform a dry run


MediaWiki version:
1.42

This script does not take any options or arguments.

Usage

[edit]
php maintenance/run.php cleanupBlocks
Terminal
In MediaWiki version MediaWiki 1.39 and earlier, you must invoke maintenance scripts using php maintenance/scriptName.php instead of php maintenance/run.php scriptName.

Not included in 1.43.3 LTS! http://web.archive.org/web/20250719171503/https://phabricator.wikimedia.org/source/mediawiki/browse/REL1_43/maintenance/cleanupBlocks.php

See also

[edit]