3
This script reads a wikibackup.pickle file and puts
4
all Pages contained there into a wiki via xmlrpc.
5
We use wiki rpc v2 here.
9
This script ONLY handles the current versions of the wiki pages.
12
* event or edit logs (page history)
13
* old versions of pages
16
* MoinMoin code or config running the wiki
18
So this is definitely NOT a complete restore.
20
GPL software, 2003-10-24 Thomas Waldmann
24
from MoinMoin.support.BasicAuthTransport import BasicAuthTransport
26
user = "ThomasWaldmann"
27
password = "xxxxxxxxxxxx"
28
dsttrans = BasicAuthTransport(user,password)
29
dstwiki = xmlrpclib.ServerProxy("http://devel.linuxwiki.org/moin--cvs/__xmlrpc/?action=xmlrpc2", transport=dsttrans)
30
#dstwiki = xmlrpclib.ServerProxy("http://devel.linuxwiki.org/moin--cvs/?action=xmlrpc2")
33
import cPickle as pickle
37
backupfile = open("wikibackup.pickle","r")
38
backup = pickle.load(backupfile)
41
allpages = backup.keys()
42
for pagename in allpages:
43
pagedata = backup[pagename]
44
dstwiki.putPage(pagename, pagedata) # TODO: add error check
45
print "Put %s." % pagename
47
if __name__ == "__main__":