want for each page in the "Free Text" column.
Any columns whose name doesn’t conform to one of the standard structures will simply be ignored.
Before or after the import is done, you will of course need to create the template or templates used, if any, by the pages resulting from the import.
The page Special:ImportXML works in the same way, but takes in a file in XML format. See the next section for the XML format that Special:ImportXML would take.
The advantage of using XML over CSV is that it can hold more than one type of page in a single file — with CSV, you would need a different file for each combination of templates, whereas with XML you can put everything in one big file. The disadvantage of using XML, on the other hand, is that it’s harder to create the file.
The homepage for the Data Transfer extension can be found here:
https://www.mediawiki.org/wiki/Extension:Data_Transfer
To import files, you can use the importImages.php script, described in the previous section.
You can also import users, if you put the user information from the other system into a CSV file first, via theImportUsers extension:
https://www.mediawiki.org/wiki/Extension:ImportUsers
Exporting contents from MediaWiki to another system
Finally, we get to the third type of transfer: one where the source is MediaWiki and the destination isn’t. This may be done for a variety of reasons: it could be because of an abandonment of MediaWiki, which of course we would never recommend. It could be done to get the wiki’s data into an automated system, for some sort of analysis or display. (If that’s the case, Semantic MediaWiki is actually the ideal way to do that — see Chapter 16 for more details.) And it could be done in order to view the contents in a format like PDF or LaTeX.
If you want to export the entire contents in a structured format, the Data Transfer extension is the best approach. Unlike import, where Data Transfer supports two formats, CSV and XML, for export only one format is supported: XML, via the page Special:ViewXML.
Special:ViewXML lets you view structured XML for different sets of pages in the wiki, by selecting any number of different categories and namespaces. The XML is in the same template-based structure as the one used for Special:ImportXML, although it can also be displayed in a simplified format.
The page is called "ViewXML", not "ExportXML", because the XML is displayed directly on the screen instead of being downloaded, when accessed by a browser. Here is an example of XML that could show up on the screen:
Frode Fredriksen
In use
/home/fredriks/Utilities/ A3J0TestSuite.pl
A testing script for performance of our A3J0 RAID servers.
...
The exact appearance will depend on one’s browser and/or relevant browser plugins.
There is also a “Simplified format” checkbox, that lets you do that same export but to a simpler XML format. Here is how that same data would appear, with the "Simplified format" option:
747
A3J0TestSuite
Frode Fredriksen
In use
/home/fredriks/Utilities/A3J0TestSuite.pl
A testing script for performance of our A3J0 RAID servers.
...
Instead of the
and
tags, the actual template and field names are used as tag names.
As you might expect, it’s then up to the external system to parse this XML, in either form, and import it into its data structure.
Unlike with the wiki’s text content, there’s no standard mechanism for exporting either a wiki’s uploaded files or its user data to a non-MediaWiki system.
You can also save some or all of a wiki’s pages into other file formats, for display purposes. There are several solutions for saving to PDF— the most popular one is the Collection extension:
https://www.mediawiki.org/wiki/Extension:Collection
Collection was developed in order to print Wikipedia articles in books, but it’s used for a variety of purposes. With the extension, one can define “collections” of wiki pages, which then, in conjunction with other extensions, can be exported to PDF, .odt (the file format used by OpenOffice and