]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/tips/convert_mediawiki_to_ikiwiki.mdwn
table name for querying the mediawiki mysql db
[ikiwiki.git] / doc / tips / convert_mediawiki_to_ikiwiki.mdwn
index 45df683de94a222ad98968c8f5675de87858b4fa..db1a1745ce302c5266e33c0e735bed46d9e5d169 100644 (file)
@@ -59,7 +59,13 @@ specific prefix: e.g. `Category:` will be stripped off.
 ### Querying the database
 
 If you have access to the relational database in which your mediawiki data is
-stored, it is possible to derive a list of page names from this.
+stored, it is possible to derive a list of page names from this. With mediawiki's
+MySQL backend, the page table is, appropriately enough, called `table`:
+
+ SELECT page_namespace, page_title FROM page;
+
+As with the previous method, you will need to do some filtering based on the
+namespace.
 
 ## Step 2: fetching the page data
 
@@ -118,7 +124,7 @@ into an ikiwiki tag name using a script such as
     pattern =  r'\[\[Category:([^\]]+)\]\]'
     
     def manglecat(mo):
-            return '[[!tag %s]]' % mo.group(1).strip().replace(' ','_')
+            return '\[[!tag %s]]' % mo.group(1).strip().replace(' ','_')
             
     for line in sys.stdin.readlines():
             res = re.match(pattern, line)