WikkaWiki Migration

Migrate WikkaWiki instances to WackoWiki.



GitHub: WikkaWiki

http://www.wikkawiki.org/HomePage
http://docs.wikkawiki.org/HomePage

1.1. Database


/Dev/Release/R6.1/Database
table structure of WackoWiki R6.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

  1. Loop through users -> create user
    • see registration action
    • create a random password and let the user reset his password
  2. Loop through pages with latest Y -> create page
    • lookup user_id and owner_id in 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 converted to track which record has already been converted
  3. Loop through pages with latest N -> create revision
    • lookup page_id
    • lookup user_id and owner_id in user table
    • save_revision(array $page)
    • add marker field converted to track which record has already been converted
  4. Loop through comments -> create page with comment_on_id
    • lookup comment_on_id
    • sort comments by time and set tag as 'Comment' . $i++
    • save_page()
  5. Loop through acls -> update acl record
    • lookup page_id
    • replace + with $
    • save_acl($page_id, $privilege, $list)

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 roundtrips by caching the page_id and user_id arrays as object, if necessary to session.


Which pages should be skiped or renamed?

  • naming conficts 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) to 1. (2 spaces)
  • ~a) to a. (2 spaces)
  • ~A) to A. (2 spaces)
  • ~i) to i. (2 spaces)
  • ~I) to I. (2 spaces)
  • ~& Comment to > Comment
  • ~~& Subcomment to >> Comment
  • ~~~& Subsubcomment to >>> 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 backported to WackoWiki.

1.4.2. Formatters

  • ""[html code]"" to <[HTML code]>
  • << left floating box << to wacko wrapper box model
  • >> right floating box >>

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.

WikiAdmin: The difficulties arise as soon as it comes to actions, WikiEdit and templates.

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

Reparse 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.

Show Files (1 file)