DokuWiki

It's better when it's simple

User Tools

Site Tools


tips:perspective

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tips:perspective [2009-03-03 01:48] – added python syntax highlighting efegetips:perspective [2014-04-14 19:39] (current) 65.244.148.222
Line 4: Line 4:
 I've migrated my company's Perspective wiki to dokuwiki. The Perspective wiki had dozens of collections and editors and attachments and hundreds of pages, and the importing script worked reasonably well.  Perspective is a Windows hosted wiki, so this is a Windows Python script.  (The path separators are hardcoded.) I've migrated my company's Perspective wiki to dokuwiki. The Perspective wiki had dozens of collections and editors and attachments and hundreds of pages, and the importing script worked reasonably well.  Perspective is a Windows hosted wiki, so this is a Windows Python script.  (The path separators are hardcoded.)
  
-**ToDo**: This script creates an "imported.log" file with the same format as "changes.log"  But it can't be merged into changes.log as is.  Andreas points out that, "The ID and the lastmod timestamp needs to match. So first create the file then get it's timestamp and save that one to the changelog."+**ToDo**:  
 +  * This script creates an "imported.log" file with the same format as "changes.log"  But it can't be merged into changes.log as is.  Andreas points out that, "The ID and the lastmod timestamp needs to match. So first create the file then get it's timestamp and save that one to the changelog." 
 + 
 +  * I found that the script was saving pages that originally had spaces in the name without spaces.  The dokuwiki behavior is to save with an underscore in place of each space.  To fix this replace this code: <code py> 
 +name = GetNode(fields, "name", "page.name").firstChild.data 
 +doku_namespace = "" 
 +doku_name = "" 
 +if name.find(":") != -1: 
 +   doku_namespace, doku_name = name.split(":"
 +   doku_namespace = "\\" + doku_namespace 
 +else: 
 +   doku_name = name 
 +</code> with this code: <code py> 
 +doku_namespace = "" 
 +doku_name = "" 
 +doku_namespace = "\\" + GetNode(fields, "name", "page.collection").firstChild.data 
 +doku_name = GetNode(fields, "name", "page.display-name").firstChild.data 
 +</code> This will also allow you to search for a full page name with spaces in the search term instead of only being able to find the page by searching for the full name without spaces or one word from the page title. 
 + 
 +  * Found that the BOM messes up the conversion, and then a few more characters in my ten-year-old PerspectiveWiki weren't liked either, so added to ParsePage:<code.py> 
 +            s = s.replace(u'\ufeff',""
 +            s = s.replace(u'\uf06c',"o"
 +            s = s.replace(u'\xad', "<<"
 +            s = s.replace(u'\xae', ">>"
 +            s = s.replace(u'\xa7', " degrees ") 
 +            s = s.replace(u'\xe0', "-"
 +            s = s.replace(u'\xef', "i"
 +</code>
  
 **Requirements**:  **Requirements**: 
-  * Python+  * Python v2
   * Windows Share access to the source and destination wikis.   * Windows Share access to the source and destination wikis.
 +
 +**Note**:
 +After running this script, run the indexer.php script in dokuwiki\bin.  This will vastly improve the search functionality.
  
 <code python> <code python>
tips/perspective.1236041300.txt.gz · Last modified: 2013-04-26 18:08 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki