[Moin-user] import another wiki dump
Tim Bird
tim.bird at am.sony.com
Thu May 24 19:57:16 EDT 2007
George Georgalis wrote:
> Hi! I'm bringing over wiki content from another
> wiki, each page is a file of wiki source.
>
> The wiki source is close enough that I can work that
> out; but I'm not sure how to import the content.
>
> I don't know moin internals other than apache setup,
> what is the most direct way to import content?
I have a pair of scripts I use for downloading all
the content from one MoinMoin wiki and placing it in
another.
They are very simple, and allow you to slurp the
content of a wiki without requiring any special
privileges (they just use http access).
I'll attach them here in case anyone's interested.
FYI - I use this to copy a wiki onto a laptop
to take on trips. It doesn't get attachments, however.
The outline is as follows:
* use wget to get the title index into /tmp/title_index
* for each line in the title index, get the page using getpage.sh
* in getpage.sh, download the raw page text directly into the
tempwiki page directory
* remove the temporary title_index file
Undoubtedly there is a simple way to make this a single script
with a for loop or something instead of xargs, but I was
lazy and it worked.
Note that this is for an older MoinMoin setup. Adjust the
wiki URLs and output path accordingly.
--------------- getwiki.sh ----------------
#!/bin/sh
wget http://tree.celinuxforum.org/pubwiki/moin.cgi/TitleIndex?action=titleindex -O /tmp/title_index
cat /tmp/title_index | xargs -n 1 /home/tbird/bin/getpage.sh
rm /tmp/title_index
--------------- getpage.sh -----------------
#!/bin/sh
wget http://tree.celinuxforum.org/pubwiki/moin.cgi/$1?action=raw -O /home/tbird/tempwiki/data/text/$1
--------------------------------------------
Regards,
-- Tim
=============================
Tim Bird
Architecture Group Chair, CE Linux Forum
Senior Staff Engineer, Sony Electronics
=============================
More information about the Moin-user
mailing list