Help:Import

From Meta, a Wikimedia project coordination wiki
This is an archived version of this page, as edited by Patrick (talk | contribs) at 12:57, 6 May 2005. It may differ significantly from the current version.

Special:Export produces an XML-file, without the MediaWiki user interface, with the wikitext of the current and optionally all old versions of one or more specified pages, with date, time, user name, and edit summary, but not whether it is a minor edit nor whether it is the first.

How it is displayed, e.g. with or without XML tags, and with or without applying newlines, depends on the browser. Some browsers show "+" and "-" links to view or hide selected parts. Alternatively the XML-source can be viewed using the "view source" feature of the browser, or after saving the XML file locally, with a program of choice.

The feature also allows searching for a text in all versions of one or more specified pages. See also XML export.

It is also meant to transfer pages from one MediaWiki-based wiki to another. However, this would require a special conversion program:

  • The rendering by a browser of the XML-source corresponds to the original wikitext, except that newlines are lost.
  • In the XML-source codes like <br> appear as &lt;br&gt;, as if what is rendered by a browser (directly or through MediaWiki) should be used as wikitext. However, as mentioned, the direct rendering by a browser causes loss of newlines, while applying MediaWiki to reproduce the wikitext works for <br> but not for bold, lists, etc.

The feature should not be confused with an XML-based replacement for or transformation of wiki markup (see e.g. Wikipedia DTD).

Here's a quick mock-up:

 <mediawiki xml:lang="en">
   <page>
     <title>Page title</title>
     <restrictions>sysop</restrictions>
     <revision>
       <timestamp>2001-01-15T13:15:00Z</timestamp>
       <contributor><username>Foobar</username></contributor>
       <comment>I have just one thing to say!</comment>
       <text>A bunch of text here.</text>
       <minor />
     </revision>
     <revision>
       <timestamp>2001-01-15T13:10:27Z</timestamp>
       <contributor><ip>10.0.0.2</ip></contributor>
       <comment>new!</comment>
       <text>An earlier revision.</text>
     </revision>
   </page>
   
   <page>
     <title>Talk:Page title</title>
     <revision>
       <timestamp>2001-01-15T14:03:00Z</timestamp>
       <contributor><ip>10.0.0.2</ip></contributor>
       <comment>hey</comment>
       <text>WHYD YOU LOCK PAGE??!!! i was editing that jerk</text>
     </revision>
   </page>
 </mediawiki>

Try Special:Export.


Caveats: should namespaces be the text, or symbolic names? Or should we leave them out entirely and let the parser deal with such a thing?

The parser needs to know the namespace's prefixes of the article's language anyway to parse the article content so it does not matter. BTW cur_counter is missing. -- Nichtich 18:09, 1 Dec 2003 (UTC)

I'm sorry, but [I] still can't get how can I e.g. export all the pages? What should I write in query window at Special:Export?

I am having the same problem. How does it work? --Donrob 08:40, 3 Jan 2005 (UTC)

Seems like instruction for import is needed too.

Yes! It is definetely needed --65.94.224.235 17:14, 20 Jan 2005 (UTC)

To start with an explanation on how to export all pages would be nice. --146.50.205.252 00:54, 1 Feb 2005 (UTC)

First, write a script that expports all pages. --brion 01:37, 2 Feb 2005 (UTC)

To my knowledge exporting all wiki pages involves several manual steps

  • get a list of all pages with specialAllPages
  • save that list into a text file
  • replace tab characters with newline (e.g. with sed) giving a list of all wiki pages, each page in a separate line
  • paste that list into special:export
  • ensure you save the XML, not the HTML representation

Support for import in another wiki seems to be on the list of tasks for mediawiki 1.5.

codes like
appear as <br>. When