Topic on Project:Support desk

Reducing the size of mediawiki database

7
109.133.131.84 (talkcontribs)

MediaWiki 1.19.9 PHP 5.3.10 MySQL 5.5.37

I have a mediawiki site which has a very large database size ( 11 GB) . I want to deploy the site onto a development server. But the development server has limited resources like disk space. So I want to reduce the size of the database to 200MB.

I tried a couple of things 1. i ran the deleteBatch.php and deleted 80% of the pages and categories in my wiki 2. I ran deleteOldRevisions.php --delete and deleted all old revisions

Earlier the size of my database was 11GB and now its only reduced to 9.5 GB which is really strange.

Can anyone tell me what am I missing here? Or whether there is a better way to reduce the size of the database? I am aware of compressing the text to reduce table sizes, but I do not wish to compress the text.

Ys, Arnab

Ciencia Al Poder (talkcontribs)

You should try to get the size of each table from the database, to look at what of them are consuming most of the space.

88.130.83.237 (talkcontribs)
109.133.143.200 (talkcontribs)

Hi, Thanks for your reply,

I can see that the _text table is 8457.00 MB and _searchindex is 3592.36 MB.

So which means that the page text did not get deleted. Do you know how to purge the text for the pages which are deleted? And how to clear the searchindex table as well?

Arnab

88.130.107.152 (talkcontribs)

When you remove a page, it does not really get deleted from your wiki, but instead gets stored in the database table "archive". You can empty this table by using the maintenance script deleteArchivedRevisions.php. See Manual:DeleteArchivedRevisions.php for details! This will also delete those rows from the "text" table, which afterwards are no longer used.

If that is not enough, you can also use the maintenance script deleteOldRevisions.php to delete all old, non-deleted revisions. This will essentially remove the history from your wiki. See Manual:DeleteOldRevisions.php for details!

To refresh the searchindex (and a few other tables), you can run the maintenance script rebuildall.php. See Manual:Rebuildall.php!

This post was hidden by Zer00CooL (history)
Zer00CooL (talkcontribs)

The same for me, and, any script work.

Mediawiki 1.33.1

Debian Buster Stable

Apache 2.4

MariaDB

PHP 7.3

deleteOldRevisions.php

...

All my page ( 350 ) = 4Mo if i export with spécial page.

In the MariaDB, the same content = 450 Mo !

I have purge the cache, and, launch all maintenance script, but, i can't reduct the size :/

Reply to "Reducing the size of mediawiki database"