MindTouch has developed a converter to migrate MediaWiki content into MindTouch. This guide provides instructions for installing and running the converter.
The MindTouch VM is the easiest way to migrate from MediaWiki to MindTouch since minimal configuration is required.
1. Log into the MindTouch VM.
2. cd /opt/deki/dist
3. Open mindtouch.deki.mwconverter.xml in a text editor and change it to match your installation:
<startup-xml> element to point to the location of the mindtouch.deki.startup.xml file. On a VM installation, use /etc/dekiwiki/mindtouch.deki.startup.xml.Below is a sample mindtouch.deki.mwconverter.xml configured for a VM:
<?xml version="1.0" encoding="utf-8" ?>
<config>
<deki>
<!-- Path to mindtouch.deki.startup.xml -->
<startup-xml>/etc/dekiwiki/mindtouch.deki.startup.xml</startup-xml>
</deki>
<!-- MediaWiki configuration settings -->
<mediawiki>
<!-- MediaWiki URL ex. http://deki-hayes/config/mw/index.php -->
<uri.converter>http://mwc.mindtouch.com</uri.converter>
<!-- MediaWiki database connection information -->
<db-server>localhost</db-server>
<db-port>3306</db-port>
<db-catalog>mediawikidb</db-catalog>
<db-user>root</db-user>
<db-password hidden="true">password</db-password>
<db-options>pooling=true; Connection Timeout=5; Protocol=socket; Min Pool Size=2; Max Pool Size=50; Connection Reset=false;character set=latin1;ProcedureCacheSize=25;Use Procedure Bodies=true;</db-options>
<!-- MediaWiki user table prefix. Leave blank if the MediaWiki database tables do not use a prefix -->
<db-userprefix></db-userprefix>
<sites>
<site>
<!-- MediaWiki table prefix. Leave blank if the MediaWiki database tables do not use a prefix -->
<db-prefix></db-prefix>
<!-- Path of the MediaWiki home page. All other pages will be placed under this page -->
<mwrootpage>Main_Page</mwrootpage>
<!-- Path to MediaWiki images folder -->
<imagedir>/mediawiki/files</imagedir>
</site>
</sites>
</mediawiki>
</config>
4. Set execute permissions: chmod +x mindtouch.deki.mwconverter.exe
5. Stop MindTouch: /etc/init.d/dekiwiki stop
6. Launch the converter: ./mindtouch.deki.mwconverter.exe.
WARNING: Running the converter will replace your existing MindTouch data.
7. Restart MindTouch: /etc/init.d/dekiwiki restart
8. Rebuild the search index
NOTE: Since MediaWiki does not support the notion of a page heirarchy, you may have a large number of pages under the home page. This flat structure can greatly increase the MindTouch navigation panel load time. To avoid this delay, you can either disable the MindTouch navigation panel or reorganize your site to have a page heirarchy.
To disable the navigation panel, edit /var/www/dekiwiki/LocalSettings.php and set the following:
$wgNavPaneEnabled = false; $wgNavPaneCallEnabled=false;
To reorganize your site to have a page heirarchy, use the Desktop Connector.
NOTE: this procedure is only necessary if you cannot use http://mwc.mindtouch.com due to privacy concerns.
To install a private copy of the MediaWiki-Bridge:
Later, if you need to update the MediaWiki-Bridge files:
Once the files for the MediaWiki-Bridge have been installed, follow the usual mediawiki installation procedure:
To configure the <uri.converter> element in mindtouch.deki.mwconverter.xml, use http://your-vm-ip/config/mw/index.php. Set your-vm-ip to either the hostname or IP address of your MindTouch VM; do not use 127.0.0.1 since it will cause subsequent conversion errors.
Using Windows to convert from MediaWiki to MindTouch is more complex than using the MindTouch VM.
The MediaWiki converter is based on MediaWiki 1.11. It's recommended to upgrade the installation to that version before attempting the conversion. mediawiki has a pretty track record of cleanly upgrading existing installations, so this step shouldn't be a chore.
You should also use the latest version of MindTouch to build your environment. Each successive version has subtle database schema changes that can cause problems during the conversion.
This section describes the steps to install the MindTouch converter. It is written from the viewpoint of someone setting up a freshly installed computer. If you are planning to use an existing installation you will need to skip the steps that don't apply.
The converter consists of two parts: a modified MediaWiki installation that will convert articles to XHTML and a C# application that creates a converter as a Dream server plugin. It expects MindTouch to be installed on the same computer (or at least I wasn't savy enought to configure it with the Dream server and MindTouch web server running on another host) along with the modified MediaWiki PHP files.
Microsoft has relased several versions of Visual Studio. Install your favorite flavor.
Install and configure a new MindTouch installation on the same computer the converter will be run on. This guide assumes the MindTouch environment is installed in C:\var\www\dekiwiki and the mindtouch.deki.startup.xml file is installed in C:\dekiwiki.
You will need a subversion client to download the MindTouch Converter source code. TortiseSVN is a reasonable choice (although you can install the subversion command line tools instead.
Create a directory where you want the MindTouch converter installed and fetch the source code from the Mindtouch Subversion server. From a command prompt enter the following command, to create directory where you want the code installed (something along the lines of C:\Documents and Settings\%USER%\src\dekiwiki\trunk is a reasonable choice, assuming %USER% is your Window user name) and fetch the source code:
C:\> cd \Documents and Settings\%USER% C:\Documents and Settings\user> mkdir src C:\Documents and Settings\user> mkdir src\dekiwiki C:\Documents and Settings\user> mkdir src\dekiwiki\trunk
Open Windows Explorer, navigate to the C:\Documents and Settings\{user}\src\dekiwiki\ directory, right click on the trunk directory and select "SVN Checkout..." from the context menu.

Note: Once you have performed this step the first time, the TortiseSVN content menu changes to "SVN Update" and you no longer have to enter the URL. When the TortiseSVN checkout dialog opens, enter the URL https://svn.mindtouch.com/source/public/dekiwiki/trunk in the "URL of Repository" text box and click "OK".

Navigate to the directory C:\Documents and Settings\%USER%\src\dekiwiki\trunk\src\tools\mindtouch.deki.mwconverter and open the Visual Studio file mindtouch.deki.mwconverter.csproj. Depending on your version of Visual Studio, it may want to perform a conversion first (Visual Studio 2008 needs to convert the project first).
There are five dependencies that you need to resolve: mindtouch.core, mindtouch.deki, mindtouch.deki.services, mindtouch.dream and mindtouch.indexservice. To resolve them, right click on the "References" folder in the Visual Studio Solution Explorer and click "Add Reference...", select the "Browse" tab in the "Add Reference" dialog box and select the five files. The files you need to add are located in the directory C:\Documents and Settings\%USER%\src\dekiwiki\trunk\web\bin. The files are:
Note: The reason these references cannot be resolved is a glitch in the mindtouch.deki.mwconverter.csproj file. Each of these references contains a <HintPath> element that points to where the file should be. The paths are set incorrectly. If you change the <HintPath>, then Visual Studio will find them. For example: The <HintPath> for mindtouch.core should be change from "..\..\bin\mindtouch.core.dll" to "..\..\..\web\bin\mindtouch.core.dll".
You may also have to add an explicit reference to mindtouch.deki.dll: <HintPath>..\..\..\web\bin\mindtouch.deki.dll</HintPath> if you edit the project file.
Open mindtouch.deki.mwconverter.xml in a text editor and change it to match your installation:
<startup-xml> element to point to the location of the mindtouch.deki.startup.xml file.Below is a config.xml file with the options used in this guide:
<?xml version="1.0" encoding="utf-8" ?>
<config>
<deki>
<!-- Path to mindtouch.deki.startup.xml -->
<startup-xml>C:\dekiwiki\mindtouch.deki.startup.xml</startup-xml>
</deki>
<!-- MediaWiki configuration settings -->
<mediawiki>
<!-- MediaWiki URL ex. http://deki-hayes/config/mw/index.php -->
<uri.converter>http://mwc.mindtouch.com</uri.converter>
<!-- MediaWiki database connection information -->
<db-server>localhost</db-server>
<db-port>3306</db-port>
<db-catalog>mediawikidb</db-catalog>
<db-user>root</db-user>
<db-password hidden="true">password</db-password>
<db-options>pooling=true; Connection Timeout=5; Protocol=socket; Min Pool Size=2; Max Pool Size=50; Connection Reset=false;character set=latin1;ProcedureCacheSize=25;Use Procedure Bodies=true;</db-options>
<sites>
<site>
<!-- Path of the MediaWiki home page. All other pages will be placed under this page -->
<mwrootpage>Main_Page</mwrootpage>
<!-- Path to MediaWiki images folder -->
<imagedir>C:\Temp\wiki-images\en</imagedir>
</site>
</sites>
</mediawiki>
</config>
Because the converter runs as a plugin to the Dream server, any output is encoded in XML and returned to the calling program. Towards the bottom of the main() function in program.cs, it invokes an HTTP POST method using service.PostAsync(). Unfortunately the PostAsync() call discards any errors and this makes it hard to tell what the program is doing. In order to display any errors encountered, change the bottom of the main() function in program.cs to the following:
Plug service = Plug.New(host.Uri.AtAbsolutePath("converter"), TimeSpan.MaxValue);
DreamMessage m = service.PostAsync().Wait();
if (!m.IsSuccessful)
Console.WriteLine(m);
else
Console.WriteLine("Success!");
Console.WriteLine("Press Enter to continue...");
Console.ReadLine();
}
}
}
WARNING: Running the converter will replace your existing MindTouch data. Once you've run the converter, you need to rebuild the search index.
If all goes well, you'll see output similar to the following.
![]()
The converter will automatically open a web browser with details about the conversion process.
NOTE: this procedure is only necessary if you cannot use http://mwc.mindtouch.com due to privacy concerns.
Create a directory where you want the modified MediaWiki files to be installed and fetch the source code from the Mindtouch Subversion server. From a command prompt enter the following command, to create directory where you want the code installed (something along the lines of C:\Documents and Settings\%USER%\src\mediawiki-bridge is a reasonable choice, assuming %USER% is your Window user name) and fetch the source code:
C:\> cd \Documents and Settings\%USER% C:\Documents and Settings\user> mkdir src\mediawiki-bridge
Open Windows Explorer, navigate to the C:\Documents and Settings\{user}\src\ directory, right click on the mediawiki-bridge directory and select "SVN Checkout..." from the context menu. When the TortiseSVN checkout dialog opens, enter the URL https://svn.mindtouch.com/source/public/mediawiki-bridge in the "URL of Repository" text box and click "OK". Note: Once you have performed this step the first time, the TortiseSVN content menu changes to "SVN Update" and you no longer have to enter the URL.
You will need to copy all of the modified MediaWiki PHP files into your MindTouch environment. The default location is in a mw subdirectory in the MindTouch config directory. The example below assumes you installed your local MindTouch in C:\var\www\dekiwiki.
C:\> cd \Documents and Settings\%USER%\src\mediawiki-bridge\ C:\Documents and Settings\%USER%\src\mediawiki-bridge\trunk> xcopy /E trunk c:\var\www\dekiwiki\config\mw Does C:\var\www\dekiwiki\config\mw specify a file name or directory name on the target (F = file, D = directory)? d
You will need a LocalSettings.php file in C:\var\www\dekiwiki\config\mw (or wherever you installed your modified MediaWiki pages). If you visit http://{IP address}/config/mw/config/index.php where {IP address} is the IP address of the conversion box (Note: on my configuration, I had to use the IP address since localhost would redirect the traffic to the Dream server), you'll be presented with the MediaWiki setup page. Enter the same values as your production MediaWiki installation, with the exception of the Database server (the database is not used during the conversion, so you can use your local copy on the MindTouch conversion box or create a new one). Copy the resultant LocalSettings.php file from C:\var\www\dekiwiki\config\mw\config to C:\var\www\dekiwiki\config\mw (or wherever you installed your modified MediaWiki pages).
Open a browser and visit http://{IP address}/config/mw/index.php. You should see "Hellow World!". If you don't you'll need to fix your HTTP configuration.
Note: If you have an older MediaWiki installation, you may get a database error that complains about tables not found. You can either return to step 1 (Prepare the MediaWiki Environment) and upgrade MediaWiki, or determine which tables are missing and manually create them now. If you chose to determine which tables are missing, open the file C:\var\www\dekiwiki\config\mw\maintenance\tables.sql to see which table definitions the modified MediaWiki expects. Open a MySQL prompt and execute
mysql> use {wikidb}; show tables;
(where {wikidb} is the name of your MediaWiki database instance). Compare each table in the tables.sql file to the list of tables in MySQL. Likely candidates will (probably) be at the bottom of the file. If any are missing, copy and paste the table defenition command from the tables.sql file into a new file mediawiki_upgrade.sql. Once you are finished, run the mediawiki_upgrades.sql file in MySQL with the following command:
mysql> source mediawiki_upgrade.sql
This section lists some MindTouch converter errors and their solutions.
Visit your new MindTouch site. In addition to playing around and getting used to how your content now looks, you should:
This section lists areas that have been known to cause problems in earlier versions of the Mediawiki converter.
It is important to point out that the Mediawiki converter is rapidly evolving and these problems may be removed as the converter is updated.
MediaWiki frequently incorporates cascading style sheets to provide a uniform layout to a set of pages. Frequently they tend to appear in MediaWiki templates. The MindTouch converter will convert the template, but may not handle the content as cleanly as you may like.
First, the converter will add calls to the the mediawiki.args template. This is a service provided by mindtouch.mediawiki.dll,. You must build and install the mediawiki extension.
The remainder of this section catalogs some cleanup required when converting a fairly simple Mediawiki template. It uses a fairly simple example that exposes a couple of things to watch out for. In this example, the following MediaWiki template is used to format the contents of a file (grabbed from some other MediaWiki page back in 2005 (I've long since forgotten where):
{| WIDTH="75%" style="background-color: _cke_saved_style="background-color: _fckstyle="background-color: #f2fff2; border: solid 1px #bfffbf;"
| style="background-color: #c1ffc1; border: solid 1px #a0ffa0" | <font size="-1">Code: {{{1}}}</font>
|-
|
{{{2}}}
|}
It expects two arguments: the name of a file, and the file contents. It can be invoked with the following Mediawiki syntax (this example shows an edit to be made to the /etc/conf.d/ntpd file:
{{Box File|<b>/etc/conf.d/ntpd</b>|
<nowiki># /etc/conf.d/ntpd
# Options to pass to the ntpd process
# Most people should leave this line alone ...
# however, if you know what you're doing, feel free to tweak
NTPD_OPTS="-u ntp:ntp"</nowiki>}}
and produces output that looks like the following:
.png?revision=3)
The converter does a very good job at converting the template and properly created a template in MindTouch with the same colors and borders, however the sytax that calls the template may have errors. For the example above, the following output appeared after running the Mediawiki converter (for every revision of this article):
line 1, column 100: invalid Primary
The converter created the following:
{{ wiki.template('Box_File', mediawiki.args(['<b>/etc/conf.d/ntpd</b>',
'<span class=\"plain\">' ..
# /etc/conf.d/ntpd
# Options to pass to the ntpd process
# Most people should leave this line alone ...
# however, if you know what you're doing, feel free to tweak
NTPD_OPTS="-u ntp:ntp" ..
'</span>'])) }}
Note: Line spacing has been added for clarity, the converter produced the output on two (very long) lines. The content of the /etc/conf.d/ntpd file contains characters that were being interpreted by MindTouch. To fix that, I had to enclose the argument in single quotes (the second argument falls between the two ellipsis, "..", and in the example above runs from the 3rd to the 8th line). Unfortunately the content of the argument actually contains a single quote in the form of an apostrophe in the word "you're" (which is one reason it was selected as an example). I modified it to the following:
{{ wiki.template('Box_File', mediawiki.args(['<b>/etc/conf.d/ntpd</b>',
'<span class=\"plain\">' ..
'# /etc/conf.d/ntpd\n
\n
# Options to pass to the ntpd process \n
# Most people should leave this line alone ... \n
# however, if you know what you\'re doing, feel free to tweak\n
NTPD_OPTS="-u ntp:ntp"' ..
'</span>'])) }}
Note: Line spacing has been added for clarity, as soon as you save the changes and edit it again, the arguments will be run together. The following steps fix the error:
This is a reasonable translation of the look and feel of the Mediawiki content. There are some issues you need to be aware of, however:
This is a very simple use of Mediawiki templates. They can easily get much more complex.
Before troubleshooting tags, make sure you rebuild the search index. Login to your newly converted MindTouch site as your administrator, and visit "Control Panel" --> "Site Settings" --> "Rebuild Site Index >>". This may take a few minutes to complete.
After running the converter and viewing the converted pages, ensure that each has the tags expected listed at the bottom of the page. Click on the tag names to ensure that all the pages have the desired tag. In my case, however, MindTouch frequently showed fewer page titles than expected or none at all (the message "There are no pages that are tagged xxx in this language." was displayed).
What made it stranger was that if I created a MindTouch tag definition page (user the tag "define:xxx"), the full set of pages showed up under "Related Pages for 'xxx'", it was only on the "Site Tags" page where results were omitted.
After munging around in the MySQL database, I found that a number of pages ended up being owned by user ID 0 (page_user_id = 0), which is non-existant. Here's a list of the MindTouch users table after the migration:
mysql> select user_id, user_name from users; +---------+-----------+ | user_id | user_name | +---------+-----------+ | 3 | Anonymous | | 2 | Moderator | | 1 | Admin | +---------+-----------+
Only those pages with page_user_id = 0 didn't show up in the Site Tags list (http://{FQDN}/Special:Tags?tag=xxx) when you clicked on a tag name. Selecting a new owner fixed the problem:
mysql> UPDATE pages SET page_user_id = 2 WHERE page_user_id = 0;
Note: I picked page_user_id = 2 because that was a moderator on my Mediawiki site.
After restarting my Dream server, all my tags were available. Woo Hoo!!!
Once you're happy, migrate the MindTouch database back to your production database using this FAQ. Be sure to restart MindTouch once you've imported your data.
Note: If you production server is Linux, you need to change the attachment path. Visit your newly migrated production MindTouch site, navigate to "Control Panel" --> "Configuration" --> "storage/fs/path" and change C:\var\www\dekiwiki\attachments to /var/www/dekiwiki/attachments.
| File | Version | Size | Modified | |
|---|---|---|---|---|
| ||||
| ||||
| ||||
| ||||
Copyright © 2011 MindTouch, Inc. Powered by
Viewing Details:

Maybe it will looks as stupid question, but I is there way how can I do it through dekiwiki running on Linux without installing Visual Studio and compiling MediaConvertor.
I don't have installed dekiwiki server on Windows (not sense at all). As well as, my question is, why people have to install Visual Studio (As I am person, which will have to install for this purpose) and compile MediaCovertor.
Why you can't provide MediaCovertor same way, as you providing other extension?
Why it can’t be part of Dekiwiki application it self?
I am just thinking about the people, which does not want complex way to transfer data, but they will appreciate simple way, where they will be able to do everything through dekiwiki interface, ie.: When they will start to do installation of DekiWiki, it will ask them (Do you want to covert data from another wiki).
How do you want to convince people with MediaWiki to go with DekiWiki, if they will have to go through long and complex process of converting?
BTW: I am still appreciate, you gave us finally some manual, how to convert data from MediaWiki. Thanks for that.
>>> The search index needs to be rebuilt since the MediaWiki to Deki Wiki converter does not update it. To do this: Tools->Control Panel->Site Settings and click "Rebuild Search Index"
The converter did a very good job at converting the template and properly created a template in Deki Wiki with the same colors and borders, however the sytax that calls the template may have errors. In my case it called the mediawiki.args template which wasn't included in the Deki Wiki 8.05 release. The same /etc/sysctl.conf file contents appeared as the following after running the Mediawiki converter (for every revision of this article):
line 1, column 119: "]" expected
>>> The reason for this is that you need mindtouch.mediawiki.dll to be present in your /var/www/deki-hayes/bin/services directory. The project for this binary exists in \public\dekiwiki\trunk\src\services\mindtouch.mediawiki edited 10:45, 13 May 2008
As for the 'mediawiki' extension. The source code is included. You'll need to compile it, place the binary in the /bin/services folder, and add it in the control panel (SID: sid://mindtouch.com/2008/04/mediawiki). edited 16:50, 18 May 2008
To import your data to the Ubuntu install, you should be able to follow this backup/restore procedure: http://wiki.developer.mindtouch.com/MindTouch_Deki/FAQ/Configuration/How_do_I...Backup_my_Deki%3f. Run the converter on your VM, back it up, and import it to an Ubuntu install (make sure it is the same version of Deki as the VM).
1) If installing convertor (MwBridge) locally - database and db user! has to be different from dekiwiki (by default they have same name)
2) Files are not created in directory attachments in 9.02.1 - bug - use trunk version or I can provide python script to fix it
I ran the mwconverter and it said it worked fine on files but I get errors - file missing - on all pages that had attachments :-(
Here are the URLs from a page in source view - <a title="File:Media_Gallery/2009_Program.pdf" href="mks://localhost/File:Media_Gallery/2009_Program.pdf">program</a> I can get to the files via http://mysite/@api/deki/files so they were migrated in to the /dekiwiki/attachments structure properly...
-- All this on the latest commercial trial 9.08.1 - CentOS5 package... installed the MWconverter via SVN to /opt/deki/dist (to be same as VM setup) - svn co https://svn.mindtouch.com/source/public/dekiwiki/9.08.1/dist/
Any ideas on what the problem might be ... how to fix ... greatly appreciated... or do I start again? edited 22:32, 1 Dec 2009