Get our free book (in Spanish or English) on rainwater now - To Catch the Rain.

Appropedia:Importing wiki pages

From Appropedia
Jump to: navigation, search

Special:Import, a tool available to admins, allows us to import pages from another MediaWiki site, with or without edit history.

What to import?[edit]

Please note that any such page on with some kind of value in environmental, design or development issues is welcome to be transwikied to Appropedia.

An Appropedia admin would be needed to do the import function, but for small tasks where history is not needed, it's enough to copy the page into Appropedia, and add an attribution notice. The author or site must be credited in an attribution statement at the bottom of the page, or the author can add the page themselves.

Often Wikipedia pages are deleted, but would actually be welcome in Appropedia. Some Wikipedia admins are helpful if the page has already been deleted - contact one of them here: Wikipedia:Category:Wikipedia administrators who will provide copies of deleted articles. (Try one and be patient, but if there is no response, try another one.)

With or without history[edit]

For stable wikis that are expected to be around for a long time, especially where the edit history of the page is likely to be long, we don't usually import the history. The attribution template used will refer the reader to the history tab on the original page.

Editing usernames before import[edit]

In cases where the history is imported, User Usernames can be edited (with a mass search and replace) in the XML document before importing, to ensure that the correct user is credited.

This is one disadvantage of Special:Import, if not handled carefully. If you import something written by a user that does not have an account, the page history will link to special:contributions/user name as though “user name” was an unregistered user. The problems are that 1. it is not clear who this contributor is, and 2. if anyone later makes an account called “user name”, they get assigned all of those edits, which they might not have made. Both of these are problems in terms of the open license we use on Appropedia.

This has happened in Appropedia with pages imported from other wikis following mergers, and elsewhere with with MediaWiki help pages that get imported into external wikis.


How to fix this by editing the XML import file:[1]

  • Rename everyone to something of the form "User name @ sourcewikiurl.org" (sourcewikiurl.org standing for the wiki where the content came from). As @ isn’t allowed in user names, no one can register and claim those edits as their own. It works as long as people don’t later make an account and get upset that those edits are not contributing towards their edit count![2]
  • If importing the user database, it's not necessary to use forbidden characters such as @. As we haven't tried yet, we're not even sure this won't cause problems with those users logging in, it's probably best to avoid this - e.g. use "User name (sourcewikiurl.org)"
  • Remember to also rewrite usernames in talk signatures - i.e. [[User:Foo...]] and [[User talk:Foo...]]

In any history or contributions page, the modified user name will to link to a non-existent pagebut at least the contributions won't be falsely attributed.

See also the bug report (still open on 24 Oct 2009).

Examples[edit]

This renaming has been done on Appropedia and Wikia.

How to[edit]

From Wikipedia:Project:WikiProject Transwiki/exporting #How to export - given for reference only (we usually don't have to worry about pages with >1000 revisions):

Do not use Special:Export, as it will only return 1000 revisions at a time, and some of the other documented features do not currently work.

  1. Instead, use http://en.wikipedia.org/w/index.php?title=Special:Export&history=1&action=submit&pages=ARTICLE_NAME or {{export}}
  2. Save the file as something.xml
  3. Use a find/replace feature of a text editor and find all "</username>" and replace it with "@en.wikipedia.org</username>"
  4. Save. You should now be ready to import the file via Special:Import on another MediaWiki wiki.


So, e.g. for English Wikipedia articles:

Replace

</username>

with:

@en.wikipedia.org</username>

Be sure to adapt as appropriate to whichever wiki you're importing from.

(Note there are other ways this could be done, but this seems to be the standard, so it's probably the best way to minimize confusion.)


Importing images from another wiki[edit]

The method above will export only the text of the wiki pages. To import images:

Notes[edit]

  1. The idea for editing the XML comes from Angela at Edits in unexpected places.
  2. Another question then is if we want to change the name later (e.g. someone wants their old contributions elsewhere merged into their new account on Appropedia). It seems like mw:Extension:User Merge and Delete will let us do that.