|MediaWiki file: deleteOldRevisions.php|
|Source code:||master • 1.26.3 • 1.25.6|
|Classes:||Find code • Find documentation|
deleteOldRevisions.php file is a maintenance script to delete all old (non-current) revisions from the revision table in the database. The script works on old, non-deleted revisions (which are stored in the revision table). The script deletes all old, non-deleted revisions from the revision table and then invokes purgeOldText.php to purge the text records which no revision links to. This can be useful for reducing the size of the database but it does mean you lose the ability to restore the according revisions.
This script deletes page histories. If you run a GFDL licensed wiki you need to be aware that the GFDL requires you to keep the page histories.
Deleting all old revisions:
php deleteOldRevisions.php --delete
Deleting all old revisions from specific pages (page id 1, 2, 15 and 38):
php deleteOldRevisions.php --delete 1 2 15 38
--delete: Actually performs the deletion. Otherwise the script will only display the number of items that it can delete.
list of page ids: Performs the deletion only on the page ids (numbers) given as unnamed arguments.
[/] # find / -name php /mnt/ext/opt/apache/bin/php [/] # find . -name deleteOldRevisions.php [/] # php ./maintenance/deleteOldRevisions.php --delete