views:

1103

answers:

1

Currently I have two MediaWikis, one a slightly older version than the other. I want to merge the contents of both together, without eliminating duplicate pages. So far the best option I can think of is to use a bot (like pywikipedia) to go through all the pages of one wiki, and try inserting them into the other, renaming duplicate pages.

This solution seems like it would take a while to accomplish though. Is there a more pleasant way to do this that I'm just unaware of? I haven't worked with the MediaWiki database directly very much, so I'm not very comfortable messing with it without knowing what I'm doing.

+3  A: 

MediaWiki has import and export features, that you can use for moving the contents. It does merge histories of existing pages (see import link).

However, it does not handle conlicts of two different pages with the same name, so you'll have to handle moving the pages by yourself. As far as I can see in description of MediaWiki page table, you might be able to find and rename duplicate pages directly in SQL, but pywikipedia should work too (but you'll need to delete redirects that will result from "correct" page moves, otherwise they'll mess up with imported pages from the other wiki).

che
I agree -- unless there are going to be several hundred duplicate pages, I recommend using the XML import/export feature.
HanClinto
From what I see of the Import feature, it looks like it's useful for small sets of files, but not as useful for larger sets. It looks like duplicate pages have to be handled by the user, and the customizing import options seems limited. Right now, pywikipedia is looking to be the best option...
spelchec