Manual:CleanupBlocks.php

MediaWiki version:
1.25
Category:MediaWiki code#CleanupBlocks.php

Details

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.43

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

MediaWiki version:
1.44
--dry-run
Perform a dry run


MediaWiki version:
1.43

This script does not take any options or arguments.

Usage

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

See also

Category:Maintenance scripts Category:User maintenance scripts
Category:Maintenance scripts Category:MediaWiki code Category:User maintenance scripts