Manual:Rebuildall.php

Details
rebuildall.php file is a maint-scripts>Special:MyLanguage/Manual:Maintenance scripts|maintenance script 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 catlinks>Special:MyLanguage/Manual:Categorylinks table|categorylinks, pglinks>Special:MyLanguage/Manual:Pagelinks table|pagelinks, and imglinks>Special:MyLanguage/Manual:Imagelinks table|imagelinks tables and refresh the searchindex>Special:MyLanguage/Manual:Searchindex table|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  or  scripts to do this.

Using the script
This script must be run from the command line.

Open a terminal or command window and change directories to the maintenance subdirectory of the wiki.

Example output
 php rebuildall.php

Dropping index... Clearing searchindex table...Done Rebuilding index fields for 1404 pages... 500 1000
 * Rebuilding fulltext search index (if you abort this will break searching; run this script again to fix):

Rebuild the index... Done.

Rebuilding $wgRCMaxAge=7776000 seconds (90 days) Clearing recentchanges table for time range... Loading from page and revision tables... Inserting from page and revision tables... Updating links and size differences... Loading from user, page, and logging tables... Flagging bot account edits... Removing duplicate revision and logging entries... Deleting feed timestamps. Done.
 * Rebuilding recentchanges table:

Refreshing redirects table. Starting from page_id 1 of 1405. 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 Refreshing links tables. Starting from page_id 1 of 1405. 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 Deleting illegal entries from the links tables... Checking interval (-INF, INF) pagelinks: 0, 2 deleted. imagelinks: 0 deleted. categorylinks: 0, 2 deleted. templatelinks: 0 deleted. externallinks: 0 deleted. iwlinks: 0 deleted. langlinks: 0 deleted. redirect: 0 deleted. page_props: 0, 5 deleted. Done.
 * Rebuilding links tables -- this can take a long time. It should be safe to abort via ctrl+C if you get bored.