view MoinMoin/scripts/xmlrpc-tools/ @ 0:77665d8e2254

tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0 (automatically generated log message) imported from: moin--main--1.5--base-0
author Thomas Waldmann <>
date Thu, 22 Sep 2005 15:09:50 +0000
children be33ecd58d4e
line wrap: on
line source

#!/usr/bin/env python
This script gets all SystemPages from srcwiki via xmlrpc and
stores them into dstwiki via xmlrpc. We use wiki rpc v2 here.

GPL software, 2003-08-10 Thomas Waldmann

import xmlrpclib
from import BasicAuthTransport

#srcwiki = xmlrpclib.ServerProxy("")
user = "YourWikiName"
password = "yourbasicauthpassword"
srctrans = BasicAuthTransport(user,password)
dsttrans = BasicAuthTransport(user,password)
srcwiki = xmlrpclib.ServerProxy("", transport=srctrans)
dstwiki = xmlrpclib.ServerProxy("", transport=dsttrans)

def transferpage(srcwiki, dstwiki, pagename):
    pagedata = srcwiki.getPage(pagename)
    dstwiki.putPage(pagename, pagedata)
    print "Transferred %s." % pagename.encode('ascii', 'replace')

allsystempagesgroup = 'AllSystemPagesGroup'
transferpage(srcwiki, dstwiki, allsystempagesgroup)
allgrouppages = srcwiki.listLinks(allsystempagesgroup)
for langgrouppage in allgrouppages:
    pagename = langgrouppage['name']
    transferpage(srcwiki, dstwiki, pagename)
    pages = srcwiki.listLinks(pagename)
    for page in pages:
        transferpage(srcwiki, dstwiki, page['name'])