(Created page with "Note, regex{{w|regular expressions}} skills needed for the xml editing. # Export from source wiki, turning on "Include templates." '''Do not import this file.''' # Determine th...") |
No edit summary |
||
Line 2: | Line 2: | ||
# Export from source wiki, turning on "Include templates." '''Do not import this file.''' | # Export from source wiki, turning on "Include templates." '''Do not import this file.''' | ||
# Determine the list of pages to be imported. | # Determine the list of pages to be imported. | ||
## Delete everything except the title lines | ## Delete everything except the title lines and turn those titles into wikilinks. (One method: Remove all linebreaks - regex matching ''\r?\n'' should work on most systems - then regex replace ''<nowiki>.*?<title>([^<]+)</title></nowiki>'' with ''<nowiki>\* [[$1]]\n</nowiki>'' and delete the last line of junk.) | ||
## Paste into an Appropedia page (e.g. the [http://www.appropedia.org/index.php?title=Appropedia:Sandbox&action=edit§ion=new Sandbox]). | |||
## Paste into an Appropedia page (e.g. [http://www.appropedia.org/index.php?title=Appropedia:Sandbox&action=edit§ion=new Sandbox]. | |||
## Delete all the blue links from the list, until that only redlinks remain. Be 100% sure, to avoid overwrite problems. (This assumes that the blue links represent the same template working close enough to the same way on both wikis.) | ## Delete all the blue links from the list, until that only redlinks remain. Be 100% sure, to avoid overwrite problems. (This assumes that the blue links represent the same template working close enough to the same way on both wikis.) | ||
# Go to the export page on the source wiki | # Go to the export page on the source wiki | ||
Line 16: | Line 15: | ||
# Double check there are no existing templates (e.g. do a quick search and eyeball each <title> line) | # Double check there are no existing templates (e.g. do a quick search and eyeball each <title> line) | ||
# Import here. | # Import here. | ||
# | # Check the templates. | ||
# Add attribution, e.g. by pasting in '''<nowiki>{{attrib wikipedia|{{FULLPAGENAME}} }}</nowiki>''' at the bottom of the "noinclude" section. (This code assumes the template is from Wikipedia and the name is unchanged.) |
Revision as of 04:34, 12 October 2012
Note, regexW skills needed for the xml editing.
- Export from source wiki, turning on "Include templates." Do not import this file.
- Determine the list of pages to be imported.
- Delete everything except the title lines and turn those titles into wikilinks. (One method: Remove all linebreaks - regex matching \r?\n should work on most systems - then regex replace .*?<title>([^<]+)</title> with \* [[$1]]\n and delete the last line of junk.)
- Paste into an Appropedia page (e.g. the Sandbox).
- Delete all the blue links from the list, until that only redlinks remain. Be 100% sure, to avoid overwrite problems. (This assumes that the blue links represent the same template working close enough to the same way on both wikis.)
- Go to the export page on the source wiki
- Paste in the short list of red links (removing the square brackets)
- Turn off "Include templates"
- Turn on "Save as file"
- Export
- Edit the xml export file:
- Strip out interlanguage links, if any - step through each one to avoid false positives. This regex match code should work: \[\[[a-z][a-z]\:[^\]]+\]\](\r?\n)? and hit delete or replace with nothing.
- Change every username - for Wikipedia, assuming you've imported only the latest revision, change usernames to "(various editors @ en.wikipedia.org)". Regex: Match \<username\>[^\<]+\</username\> and replace with <username>(various editors @ en.wikipedia.org)</username>
- Double check there are no existing templates (e.g. do a quick search and eyeball each <title> line)
- Import here.
- Check the templates.
- Add attribution, e.g. by pasting in {{attrib wikipedia|{{FULLPAGENAME}} }} at the bottom of the "noinclude" section. (This code assumes the template is from Wikipedia and the name is unchanged.)