Since Tiki4, there is a built-in importer. Please see: MediaWiki importer.
Dmitry Ganin and Medha Parlikar did a migration script from MediaWiki to TikiWiki. The code is attached in this page. Below the documentation of the script.
I plan to study this script as part of my GSOC 2009 project.
Documentation
Migration Scripts
There are several scripts to perform migration from MW to Tiki.
Script name
Location on migrationbox
Description
{Herndon|Orem}_check_tables.pl
/root/migration
(actually can be run from any directory)
Perl script. Extracts text of each MW page from MW DB and check it for incorrect table markup. Outputs found issues to STDOUT. Does not change any data in MW or Tiki databases
{Herndon|Orem}_mw2html.pl
/root/migration
(actually can be run from any directory)
Perl script. Extracts text of each MW page from MW DB, converts it to HTML (with use of CPAN Perl module Text::MediaWikiFormat) and saves converted text to temporary table in MW DB. Temporary table is being
recreated at each run of the script. During conversion to HTML script processes attached files: finds attached files in MW images location, copies found files to ‘files’ subdirectory under base Tiki directory, inserts corresponding record into ‘tiki_wiki_attachments’ table of Tiki DB and inserts HTML link containing attachment ID to the text of converted page.
{Herndon|Orem}_import_mw_pages.php
/var/www/html/migration
(base Tiki directory)
PHP script. Takes HTML text of each page from temporary table created by Perl script and imports page in Tiki with use of functions from standard Tiki library.
import_mediawiki_pages.php
/var/www/html/migration/import
(${tiki_base}/ import)
PHP module containing code used by {Herndon|Orem}_import_mw_pages.php scripts
{Herndon|Orem} - means prefix in filename of script. I didn’t care
about implementation of external configuration file support. I simply
created separate copy of each script per MW instance. The only
difference between Herndon_* and Orem_* are configuration settings -
DB settings and paths. Configuration section containing all settings
can be found at the beginning of each script.
Migration Procedure
- Update MW databases and locations on migrationbox with latest dumps and tarballs.
- On proddev-wiki grant all privileges on production Tiki DB to MySQL user mw2tiki’@’migrationbox.orm.omniture.com’.
- Configure migration Tiki instance on migrationbox to work remotely with production Tiki DB on proddev-wiki (/var/www/html/migration/db/local.php).
- Check and correct configuration settings in migration scripts. {Herndon|Orem}_mw2html.pl scripts contain settings for Tiki DB - these settings should be changed to point scripts to production DB.
- Shut down apache on wiki to avoid any access to DB by users.
- Run _check_tables.pl scripts. Correct detected issues if any.
- Run Herndon_mw2html.pl script.
- Run Herndon_import_mw_pages.php
- Open page ‘Main_Page’ in migration Tiki and rename this page to, for example, ‘DoP_Main_Page’. This is necessary to do to avoid conflict with ‘Main_Page’ from Orem MW.
- Run Orem_mw2html.pl script.
- Run Orem_import_mw_pages.php script.
- Go to Tiki ‘Manage attachments’ page: Press ‘Change all to db’ button.
- Migration complete.
{Herndon|Orem}_mw2html.pl scripts output warnings if
can’t find MW attachments.
{Herndon|Orem}_import_mw_pages.php scripts output name of the each
processed page and page names conflicts if any.
So, it’s useful to redirect output of scripts to files or to less command.