[Mediawiki-l] 'Integrating' one wiki with another--how does this strategy sound?

Ken McDonald ken at pixologic.com
Tue Jan 30 19:40:30 UTC 2007


We have a private wiki, which will eventually become public. We would 
like to integrate the pages from our current public wiki into the 
private wiki. The wikis are in different databases. Also, the public 
wiki table names have a different prefix than the private wiki pages. 
Here's the strategy I've come up with for doing this, and I'd appreciate 
if anyone could point out potential problems, or an easier way of doing 
things.

Fortunately, the amount of editing that will be done on the public wiki 
after a copy is integrated into the private wiki will likely be small; 
so we can handle such cases manually when we're ready to take the 
private wiki public.

For simplicity, I'll call the private wiki I (for internal) and the 
public wiki P.

Here's the strategy:

1) Dump P.
2) Do a simple text substitution on the dumped text file to change the 
table name prefix appropriately.
3) From that dump file, create a copy of P (with prefix names changed), 
I'll call it P2.
4) Check P2 to make sure everything is OK so far.
5) We have already copied a few pages from P to I, and modified them; 
so, write a SQL script to remove pages that already exist in I from P2. 
I'll have to figure out which tables are affected by this.
6) Write a SQL script to transfer all pages from I to P2 (this makes 
sure we don't screw up the current I).

Here's a more problematic part;

7) Write a script (in python, for me) that will go through the images 
directory in I, and copy the images to the same locations relative to 
the P2 images directory. I'm guessing this will work, but don't know 
enough about image storage and indexing to be sure. Alternatively, I 
could simply not transfer image information over from I, and then use 
importImages.php to import all of those images; but again, I'm not sure 
if there might not be some table dependencies that would make this 
difficult. Comments here are very welcome!
8) P2 now becomes I.

And that's it.


Many thanks in advance for any comments you can give (and I also hope 
that some of the ideas in this might help others).

Ken



More information about the MediaWiki-l mailing list