WikkaWiki Migration
Migrate WikkaWiki instances to WackoWiki.
1. Migration
http://www.wikkawiki.org/HomePage
http://docs.wikkawiki.org/HomePage
1.1. Database
Create a backup.
Install a new WackoWiki instance in the same database.
1.2. Action
{{wikkawiki_migration}}
Both installations should be in the same database, each installation has a distinct table prefix, e.g. wikka_ or wacko_.
{{wikkawiki_migration
wikka_prefix="wikka_"
option1=0
option2=1
etc...
}}
1.3. Tables
- Loop through
users-> create user- see registration action
- create a random password and let the user reset his password
- Loop through
pageswithlatestY -> create page- lookup
user_idandowner_idin user table -
save_page($tag, $body, $title = '', $edit_note = '', $minor_edit = false, $reviewed = 0, $comment_on_id = 0, $parent_id = 0, $lang = '', $mute = false, $user_name = '', $user_page = false) - add marker field
convertedto track which record has already been converted
- lookup
- Loop through
pageswithlatestN -> create revision- lookup
page_id - lookup
user_idandowner_idin user table -
save_revision(array $page) - add marker field converted to track which record has already been converted
- lookup
- Loop through
comments-> create page withcomment_on_id- lookup
comment_on_id - sort comments by time and set
tagas'Comment' . $i++ -
save_page()
- lookup
- Loop through
acls-> update acl record- lookup
page_id - replace
+with$ -
save_acl($page_id, $privilege, $list)
- lookup
Wikka tabels
- pages
- users
- comments
- acls
The Routine should implement a batch option to prevent a server timeout, e.g. process only [10, 50, 100] records at once.
Avoid SQL round-trips by caching the page_id and user_id arrays as object, if necessary to session.
Which pages should be skiped or renamed?
- naming conflicts with default installation
- obsolete system pages
1.4. Syntax
Loop through each record in page and revision table and convert and update body and set converted to 1, 2, 3.
<?php $data = $this->format($this->page['body'], 'wikka2wacko');
-
++Strike through text++to--Strike through text-- -
''highlight text''to!!highlight text!! -
======to==(requiers@@@transition placeholder to avoid double replacements) -
=====to=== -
====to==== -
===to===== -
==to====== -
~to(2 spaces) -
~~to(4 spaces) -
~-to*(2 spaces) -
~1)to1.(2 spaces) -
~a)toa.(2 spaces) -
~A)toA.(2 spaces) -
~i)toi.(2 spaces) -
~I)toI.(2 spaces) -
~& Commentto> Comment -
~~& Subcommentto>> Comment -
~~~& Subsubcommentto>>> Comment -
[[SandBox | Test your formatting skills]]to[[SandBox Test your formatting skills]] -
[[http://example.com | Home Page]]to[[http://example.com Home Page]]
and so on...
See Latex formatter for conversion examples of page body.
Advanced tables and actions probably require an extra mapping.
The admin_replace or the admin_massregex action can be used here.
1.4.1. Actions
action to syntax
- image
- color
- table
special cases
-
{{{action}}}to {{action}}
In some cases a replacement can be mapped and replaced with the WackoWiki equivalent action.
Some action can be back-ported to WackoWiki.
1.4.2. Formatters
-
""[html code]""to<[HTML code]> -
<< left floating box <<to wacko wrapper box model -
>> right floating box >>
brianko: Note: This might be a good opportunity to implement a Wikka markup formatter. Multiple formatters for different markups would be a nice addition and would allow for manual migration of discrete pages as well.
1.5. ACLs
- replace
+with$(registered users)
1.6. Uploads & Media
What about uploads?
Uploads must be re-uploaded and possibly re-embedded via the file: syntax.
WikkaWiki uses here a image action which must be replaced.
- local media
- external media
1.7. Finish
Re-parse all pages via the admin panel.
Drop converted field again from page and revision table.
1.8. Wikka Default Theme
Backport WikkaWiki default theme to WackoWiki.
2. Converter
- https://github.com/jgm/pandoc
- add WackoWiki as Format (PR)
Files
| physical_current_x.png | 85.0 KiB | 05/30/2024 10:50 |


