Kerim Friedman wrote:
When I first installed Media Wiki a while ago I neglected to add a useful prefix to the MySQL tables, such as "wiki_". Now, I've merged my MySQL tables and I don't know which is which. How could I add a prefix to all the MediaWiki tables on an already installed Wiki? I'm using version 1.4.x, I'd be happy to upgrade to a newer version if it would help with the process...
You can rename a table in MySQL using the ALTER TABLE statement like this:
ALTER TABLE cur RENAME TO wiki_cur;
The complete set of table definitions is in maintenance/tables.sql, so you can make a list of all the tables you need to rename there.
You'll also have to set $wgDBprefix in LocalSettings.php to match, eg:
$wgDBprefix = "wiki_";
-- brion vibber (brion @ pobox.com)