Ok, this is something which was a bit hard to find, basically because “deleting deleted stuff” isn’t really an easy search… So here we go, how to definitely remove from the database some useless junk, aka deleted revisions and deleted files.
As usual, we used the latest MediaWiki version available at time of writing, which is version 1.12.0.
Extra-requirements (eg, what’s needed apart from the normal stuff to run MediaWiki): php command line (for php5, the package is php5-cli).
1. Make A BACKUP of your database and image folder first (NB: in the images folder, you don’t need to backup the “temp” and “thumb” directories)
2. Go, with the console, to the maintenance folder of the wiki.
3. To erase the deleted files, type:
php deleteArchivedFiles.php --delete
If you get messages of files not found in group ‘deleted’, it probably means that you already deleted these files manually. In this case you need to finish the job by emptying the [your_database_prefix]filearchive table manually (eg with phpMyAdmin).
4. To erase the deleted revisions, type:
php deleteArchivedRevisions.php --delete
(NB: this basically empties the [your_database_prefix]archive table)
Then, you must delete also the *text* of these revisions, using the following:
php purgeOldText.php --purge
That’s all, don’t forget to browse around your wiki a bit to make sure everything is fine. Also, note that this doesn’t clean up the deletion log. So when trying to re-create a page that was previously deleted and the erased as above, you’ll still have a “restore” option. But the restoration page will have no revisions and/or files available for restoration.
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.