Help:Reduce size of the database

From lensowiki

Jump to: navigation, search

  It may be possible to reduce the size of the database.

Contents

Compress old revisions

cd /path/to/wiki/maintenance
php compressOld.php

In MediaWiki 1.2 and 1.3, this will reduce the size of the old table (which is typically the bulk of the database) by about 50%. In MediaWiki 1.4, it will typically reduce the size of the old table by about 85%, but at the expense of making it difficult to delete existing articles.

(Q: "difficult" as in you'll have to do some sql manipulation? or difficult as in computationally expensive?)

Permanently remove the history of deleted pages

To permanently remove the history of deleted pages, first delete the pages using the normal page deletion feature.

Then clear out the archive table, where deleted revisions are stored, at the database level:

DELETE FROM archive;

or (which is sometimes MUCH faster)

TRUNCATE TABLE archive;

Of course, it will then no longer be possible to view and restore deleted pages and their history.

Permanently remove old revisions

< Mediawiki 1.5beta3

To permanently remove the histories of all current pages clear out the old table, where old revisions are stored, at the database level:

DELETE FROM old;

or (which is sometimes MUCH faster)

TRUNCATE TABLE old;

Be absolutely sure you don't want any of your pages' histories, though, as that information will be completely and permanently blown away by this. All prior versions will be gone entirely; they will not appear in 'History', will not appear in 'User contributions', cannot be viewed, diffed, or reverted to.

If you insist on doing this it is very strongly recommended to back up your database first in case you need to reference an older version later (or you just make a mistake!).

You can rebuild the index of recent changes to ensure that old entries no longer appear in Special:Recentchanges.

php rebuildrecentchanges.php

>= Mediawiki 1.5beta3

Looking into providing a script. Rob Church Talk 15:23, 25 January 2006 (UTC)

A script is available at the bug entry 4748. Be careful, save your database before testing it ! Zaijian 17:11, 5 February 2006 (UTC)

php deleteOldRevisions.php --delete

--Wissenslogistiker 23:35, 5 February 2006 (UTC)

Mediawiki 1.6.7.

Use SpecialDeleteOldRevisions.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox