Thread:Project:Support desk/What is the easiest way to restore a Searchindex?

Summary:
 * I recently restored a backup from 1.6.6 to 1.16.5, via importDump.
 * See Mediawiki mysql and importDump restore failures from 1.6.6 to 1.17.0.
 * The pages appear intact, but the Searchindex is gone.
 * My questions:
 * 1) Is there a maintenance script or other method to rebuild the full Searchindex?
 * 2) Does a MySQL restore also restore the Searchindex?
 * 3) * If so, how does one get around the MySQL bug mentioned in the previous thread?

Details:  CREATE TABLE ddmscategorylinks ( cl_from int(8) unsigned NOT NULL default '0',  cl_to varchar(255) binary NOT NULL default ,  cl_sortkey varchar(86) binary NOT NULL default ,  cl_timestamp timestamp(14) NOT NULL,  UNIQUE KEY cl_from (cl_from,cl_to),  KEY cl_sortkey (cl_to,cl_sortkey),  KEY cl_timestamp (cl_to,cl_timestamp) ) TYPE=MyISAM;  DROP TABLE IF EXISTS `ddmscategorylinks`; /*!40101 SET @saved_cs_client    = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ddmscategorylinks` ( `cl_from` int(10) unsigned NOT NULL DEFAULT '0',  `cl_to` varbinary(255) NOT NULL DEFAULT ,  `cl_sortkey` varbinary(70) NOT NULL DEFAULT ,  `cl_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,  UNIQUE KEY `cl_from` (`cl_from`,`cl_to`),  KEY `cl_sortkey` (`cl_to`,`cl_sortkey`,`cl_from`),  KEY `cl_timestamp` (`cl_to`,`cl_timestamp`) ) ENGINE=InnoDB DEFAULT CHARSET=binary; /*!40101 SET character_set_client = @saved_cs_client */;
 * Environment:
 * PHP version 2.3.0, mysql Ver 14.14 Distrib 5.1.53, SQLite 2.8.17, all from the openSuSE 11.4 (current) distribution.
 * openSuSE has SQLite 3.7.5 as well as 2.8.17. I have no idea why it chose the earlier version.  Is it safe to install the newer one?
 * The mediawiki install also warned: Connected to mysql 5.1.53-log; You are using MySQL 4.1 server, but PHP is linked to old client libraries ...
 * First option: rebuild the Searchindex.
 * I restored with dumpBackup into an SQLite database. (Was this a bad idea?)
 * The restored pages appear to be intact, but searches find nothing. Words I know are on the pages are not found.
 * There is an updateSearchIndex.php file in maintenance, but its documentation page says it only works on Special:Recentchanges. There is nothing that I can find which allows me to mark all pages as "Recentchanges."
 * Would the importDump have restored the Searchindex if I had used MySQL instead of SQLite?
 * I also tried looking inside the SQLite database to confirm that the index was empty.
 * MediaWiki has created a file "dbase.sqlite"
 * The structure is documented in Manual:Searchindex table (Why are the instructions only for 1.18 and 1.19? 1.17.0 is the current donwload.)
 * I attempted to confirm that the search table was empty.
 * When I type "sqlite dbase.sqlite" SQLite replies:
 * "Unable to open database "dbase.sqlite": file is encrypted or is not a database"
 * I have located /wiki/includes/db/DatabaseSqlite.php but it appears only to open the database. How can I access the database from sqlite on the command line?
 * Second option: restore the full mysqldump backup.
 * My alternative is to persevere at doing a restore of the MySQL dump.
 * The problem here is that earlier versions of MediaWiki used an index structure for which the present MySQL reports "Specified key was too long; max key length is 1000 bytes"
 * The error message gives a line number. The "offending" SQL is:
 * This is the second "CREATE TABLE" command in the dump. Either this one has a problem, or encountering this caused MySQL to process the previous one.
 * The same table, in a fresh MediaWiki 1.16.5 install dumps as:
 * To my untutored eyes, the SQL looks the same, except int(8) became int(10) in 'cl_from', and the timestamp became more complex. It is certainly possible that the /*! comments change something fundamental, but that is beyond my understanding.
 * Is there something in maintenance or elsewhere that can reformat my "old" MySQL dump?
 * As you can see, this attempt to rebuild the index has become a maze.
 * Can someone please suggest a reliable path through the maze?
 * Finally, when creating the MySQL-based wiki, I took the default InnoDB engine.
 * In looking through MediaWiki manual pages, I have found both InnoDB and MyISAM recommended as the preferred database, on different manual pages.
 * Is there a reason to prefer one of them in this case?
 * Thanks in advance for any advice you can provide!