Manual:rebuildall.php

From MediaWiki.org
Jump to: navigation, search
MediaWiki File: rebuildall.php
Location: /maintenance/
Source code:

HEAD1.18beta1
1.18.11.17.2

Classes: None

rebuildall.php is one of the scripts included in the maintenance/ directory of your Mediawiki installation. Its purpose is to rebuild the links and indices used for searching your site.

You should run this script after importing some data into your wiki. It will populate the categorylinks, pagelinks, imagelinks tables and refresh the search index. It will not import or "register" images (even if they are in upload directory and there are articles referencing them). You should use the rebuildImages.php or importImages.php scripts to do this.

Contents

[edit] Using the script

This script must be run from the command line.

If you are using MediaWiki 1.16.x or older: Before running the file, make sure you have an AdminSettings.php file in your wiki directory. If not, rename the AdminSettings.sample file to AdminSettings.php. Then edit the database user name and password in AdminSettings.php, exactly as you did for LocalSettings.php.

Next, open a terminal or command window and change directories to the maintenance subdirectory of the wiki.

[edit] Windows

cd C:\path\to\wiki\maintenance
C:\path\to\php.exe rebuildall.php

[edit] Linux/Unix

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

That's all!

[edit] Example

vi-notebook:/var/lib/mediawiki1.7# cat AdminSettings.php   # Create this file if not exist
<?php
  $wgDBadminuser    ="root";
  $wgDBadminpassword='Root access to the MySQL may lead to root access to the host.';
?>

vi-notebook:/var/lib/mediawiki1.7# php maintenance/rebuildall.php
** Rebuilding fulltext search index (if you abort this will break searching; run this script again to fix):
Dropping index...
Rebuilding index fields for 1426 pages...
1000
Rebuild the index...


** Rebuilding recentchanges table:
Loading from page and revision tables...
Updating links...


** Rebuilding links tables -- this can take a long time. It should be safe to abort via ctrl+C if you get bored.
Refreshing link table.
Starting from page_id 1 of 1426.
100
200
300
400
500
600
700
800
900
1000
1100
1200
1300
1400
Done.

[edit] See also

Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox