Difference between revisions of "Migrating mediawiki from mysql to sqlite"
From Linuxintro
imported>ThorstenStaerk |
imported>ThorstenStaerk |
||
Line 1: | Line 1: | ||
+ | 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 | ||
+ | * 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. | 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. | ||
Revision as of 13:09, 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
- 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.
- backup LocalSettings.php
- use https://gist.github.com/esperlu/943776/ to get a file wikidb.sqlite
# ./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