mysqlwikimediawikimergepywikibot

Merging MediaWiki contents together


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.


Solution

  • 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).