Difference between revisions of "Migrating mediawiki from mysql to sqlite"

From Linuxintro
imported>ThorstenStaerk
imported>ThorstenStaerk
Line 8: Line 8:
 
** re-doing things like mediawiki extensions on the new wiki
 
** re-doing things like mediawiki extensions on the new wiki
 
** re-doing your settings e.g. from LocalSettings.php on the new wiki
 
** re-doing your settings e.g. from LocalSettings.php on the new wiki
 +
: [http://technology.mattrude.com/2010/01/converting-a-mediawiki-database-from-mysql-to-sqlite/ Matt gives a good overview about this]
 
* just migrate the database below your wiki
 
* just migrate the database below your wiki
  

Revision as of 13:10, 7 September 2013

To migrate a mediawiki from MySQL to SQLite there are two basic approaches:

  • start with a new database and worry about
    • dumping all pages but the Main Page with the dumpBackup command and restoring them with the importDump command
    • copying the Main Page from the old wiki to the new
    • copying the users and privileges from the old wiki to the new
    • copying the wiki statistics (like page visits) from the old wiki to the new
    • copying images and other files from the old wiki to the new
    • re-doing things like mediawiki extensions on the new wiki
    • re-doing your settings e.g. from LocalSettings.php on the new wiki
Matt gives a good overview about this
  • just migrate the database below your wiki

I tried to migrate my mediawiki installation from mysql to sqlite. To do this I wanted to just convert the database below it, change LocalSettings.php and be good with it. Parts went surprisingly well, but other parts not. This is not a ready tutorial, but here to give you some ideas.

# ./mysql2sqlite.sh -u wikiuser -pyourpassword wikidb | sqlite3 wikidb.sqlite
  • change LocalSettings.php to reflect
$wgDBtype = "sqlite";
$wgDBserver = "";
$wgDBname = "mywiki";
$wgDBuser = "";
$wgDBpassword = "";
$wgSQLiteDataDir = "/srv/www/htdocs";

Then name your .sqlite file /srv/www/htdocs/mywiki.sqlite.

  • chown your .sqlite file
  • run maintenance/update.php

See also