WikkaWiki Migration
Migrate WikkaWiki instances to WackoWiki.GitHub: WikkaWiki[link1]
- Wikka_default.sql[link2]
http://docs.wikkawiki.org/HomePage
- Wikka Table Structure[link3]
- Wikka Text Formatting[link4]
1.1. Database
/Dev/Release/R6.1/Database[link5]
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
pages
withlatest
Y -> create page- lookup
user_id
andowner_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
- lookup
- Loop through
pages
withlatest
N -> create revision- lookup
page_id
- lookup
user_id
andowner_id
in 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
tag
as'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 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 inpage
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 -
~~
to -
~-
to*
(2 spaces) -
~1)
to1.
(2 spaces) -
~a)
toa.
(2 spaces) -
~A)
toA.
(2 spaces) -
~i)
toi.
(2 spaces) -
~I)
toI.
(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[link6]: 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.- [link1] https://github.com/bakoontz/WikkaWiki
- [link2] https://github.com/bakoontz/WikkaWiki/blob/master/sql/Wikka_default.sql
- [link3] http://docs.wikkawiki.org/WikkaTableStructure
- [link4] http://docs.wikkawiki.org/TextFormatting
- [link5] https://wackowiki.org/doc/Dev/Release/R6.1/Database
- [link6] https://wackowiki.org/doc/Users?profile=WikiAdmin