Task
Motivation
When moving files, all local links either become red links or point to different pages. However, we want to be able to persist where links lead to, too.
Acceptance Criteria
- For all links with namespaces that are not the category namespace, link to the source wiki namespace (as this is where the link was supposed to link to). EG: [[1st Security Force Assistance Brigade]] should be changed to [[:en:1st Security Force Assistance Brigade|1st Security Force Assistance Brigade]]
- The category namespace should stay pointing to the target wiki, as we expect the categories now to be used on the new wiki
Original Report
I've been playing around with the FileImporter tool a bit, and noticed that it causes lots of redlinks because it doesn't update wikilinks to point to the originating wiki. This can be fixed manually, but it would make sense for the tool to do this automatically. For example, I imported the file :File:1st Security Force Assistance Brigade Flash.svg, and had to manually change [[1st Security Force Assistance Brigade]] to [[:en:1st Security Force Assistance Brigade|1st Security Force Assistance Brigade]], [[United States military beret flash|unit flash]] to [[:en:United States military beret flash|unit flash]], and [[User:McChizzle]] to {{User at project|McChizzle|w|en}}.
It seems like it should be a fairly easy task to add the originating wiki's interwiki code and to pipe wikilinks that now need piping to hide the code. Detecting usernames and using {{User at project}} would be useful too.
Bonus points if the code is smart enough to only do it to redlinks.