Rename a MediaWiki database

From Organic Design wiki
Revision as of 03:37, 2 May 2009 by Nad (talk | contribs) (not cat installation)
Procedure.svg Rename a MediaWiki database
Organic Design procedure

The simplest approach is to take a sql dump of a database;

{{{1}}}


and manually edit the lines in backupfile.sql

<PHP>
CREATE DATABASE /*!32312 IF NOT EXISTS*/ [database]
USE DATABASE [database]

</PHP>


then restore the mysqldump file with;

<PHP>

mysql -u [user] -p [database] < backupfile.sql # Restore </PHP>

In the LocalSettings.php file, the global

{{{1}}}

may need to be changed to point to the new database. Privileges may also need to be set in the db table in the mysql permissions database.