WikiCopier.exe is a console application which copies a head version of wiki from one server to another without the page history.

This application has the following command line arguments:
WikiCopier.exe "http://oldwikiwithdata.wik.is/@api/deki" "login" "password" "http://newwiki.somename.local/@api/deki" "login" "password" "oldwikiwithdata.wik.is" "newwiki.somename.local"

First wiki url address should be of the OLD website with the data which should be copied. Logins and passwords should be with admin rights. If wiki is public use "no" "no" instead of the login and password. The last two arguments are used for internal absolute links fixing.

There are some useful Deki Wiki API code examples:
Authentication:
Plug p = Plug.New(sNewWebSiteName);
p.At("users", "authenticate").WithCredentials("Login", "Password").Get();

Delete pages:
p.At("pages", "docID").With("recursive", "true").Delete();

Get all the pages:
DreamMessage document = p.At("pages").With("format", "xml").Get();

Get page content:
DreamMessage docContent = p.At("pages", "PageID", "contents").With("format", "xhtml").Get();

Post page content:
p.At("pages", "=PagePath", "contents").With("abort", "never").Post(dm.AsDocument());

Get page attached files:
DreamMessage document = p.At("pages", "PageID", "files").Get();

Attach file to the page:
p.At("pages", "pageid", "files", "=" + msg.ContentDisposition.FileName).Put(msg);

most of information about the Deki Wiki API can be found here

Last edited Mar 4, 2010 at 5:00 PM by ashvalev, version 10

Comments

No comments yet.