Original MediaWiki import/export mechanism exports only page texts, but not uploaded files.

This is fixed in the MediaWiki4Intranet MW distribution (Bug:47362) using a patch to MediaWiki code (see #Links). This is not the only feature, there are many useful features added.

The features are listed below. With all these improvements, the import mechanism is backwards compatible and is able to import dumps from MediaWikis without these improvements.


Upload export/import

We've implemented file upload export and import. There are two options:

To implement this, we also needed to change filerepo/LocalFile.php slightly, because in the stock MediaWiki, old upload revisions have a strange "archivation timestamp», usually equal to the timestamp of next revision. Moreover, sometimes it's not just equal to timestamp of the next revision, but differs from it a second or two. The patch fixes this behaviour, so each old upload has it's own timestamp in the name, and their names become independent of the next revision, so the import/export also becomes more correct.

Caution.svg Because of this change, if you apply the patch to a non-empty MediaWiki installation, you need to run a maintenance tool from #Links which will rename old uploaded files.

Advanced page selection

We've also implemented advanced selection of pages for export:

After page selection, the following filters could be applied:

Also, IntraACL rights are supported — закрытые от чтения страницы не попадают в список выбранных, также в список в этом случае не попадает лишняя страница «Доступ запрещён».

Conflict detection

The stock MediaWiki import/export works very simply — it creates the revisions and tells «done». In more later versions, it tells «done, something uploaded», or «done, nothing uploaded» for each imported page. But it's not enough if you use it often: you want to see where the newer version was, was it changed by someone and etc. These features are available in our version, and it adds DVCS-like functionality into MediaWiki — you can exchange revision sets between many Wiki installations.

This is called "import conflict detection" and advanced import report. It includes a message for each imported page, it can be of one of 5 types:

  1. All revisions were previously imported. No local changes.
  2. All revisions were previously imported. Page changed locally.
  3. N revisions imported.
  4. N revisions imported (new page).
  5. N revisions imported (conflict: XX (import) and YY (local)).


Installation is very simple: