

You may need to add more conversions here depending on the precise page titles Wget -q "$wiki?title=$src&action=raw" -O "$dest" Assuming $pagenameĬontains a pagename obtained above, and $wiki contains the URL to your You need to create two derived strings from the page titles: theĭestination path for the page and the source URL.

Once you have a list of page names, you can fetch the data for each page.
#Mediawiki export all pages install#
Here are reproduced the ones you are most likely to encounter if you are running a small mediawiki install for your own purposes: Index The list of default namespaces in mediawiki is available from. MySQL backend, the page table is, appropriately enough, called table: SELECT page_namespace, page_title FROM page Īs with the previous method, you will need to do some filtering based on the Stored, it is possible to derive a list of page names from this. If you have access to the relational database in which your mediawiki data is Note that the page names obtained this way will not include any namespace (See below for the default list of namespaces) You need to add a &namespace=XX argument to get pages in aĭifferent namespace. Note that by default, Special:Allpages will only list pages in the main In HTML, you may need to add further processing to the last line. Tables = dom.getElementsByTagName("table")Īnchors = pagetable.getElementsByTagName("a")Īlso, if you have pages with titles that need to be encoded to be represented You have tweaked your mediawiki theme a lot from the original, you will needįrom import parse, parseString That this script is sensitive to the specific markup used on the page, so if

If you fetch the output of this page to a local file with something like wget -q -O tmpfile ' You can extract the list of page names using the following python script. Mediawikis have a special page called Special:Allpages which list all the There are several different ways of obtaining these. The first bit of information you require is a list of pages in the Mediawiki.
#Mediawiki export all pages full#
We do not yet cover importing the history of edits.Īnother set of instructions and conversion tools (which imports the full history)Ĭan be found at Step 1: Getting a list of pages The following instructions describe ways of obtaining the current version of Possible to import the contents of a Mediawiki site into an ikiwiki,Ĭonverting some of the Mediawiki conventions into Ikiwiki ones. Pages are marked up using a proprietary markup. Mediawiki is a dynamically-generated wiki which stores its data in a Step 4: Mediawiki plugin or Converting to Markdown.
