XwikiXfer
DescriptionCopy files between WMF wikis.
AuthorUser:Alexis Jazz
UpdatedAugust 18, 2025; 9 months ago (2025-08-18)
SourceUser:Alexis Jazz/XwikiXfer.js

XwikiXfer (Crosswiki Transfer) is a user script that can copy files from one WMF wiki to another. It also replaces file usage. Example use cases:

  • You find a corporate logo on Wikimedia Commons that exceeds the threshold of originality of its source country, but not that of the US, so it's allowed on English Wikipedia as {{PD-ineligible-USonly}}.
  • You find a photo of a building that no longer exists on Wikimedia Commons. The photo is a copyright violation, but it would be allowed on English Wikipedia as fair use.
  • You find a photo on Wikimedia Commons that is in the public domain in the US, but it's from a PMA 70 country and the author died less than 70 years ago. It would be allowed on English Wikipedia as {{PD-USonly}}.
  • You find a fair use file on Italian Wikipedia that would be useful on English Wikipedia too.

How to install

edit

Add this to m:Special:MyPage/global.js to load the script globally:

mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Alexis_Jazz/XwikiXfer.js&action=raw&ctype=text/javascript');

To load the script on a specific Wikimedia project, add the line to Special:MyPage/common.js on the project in question instead.

How to use

edit

Navigate to a file page. When the script is loaded a link titled "XwXf" will be added to your sidebar/toolbar. Click it and a crude interface will be shown. Here you enter the domain of the target wiki and the filename to upload to. You also have a chance to adjust the wikitext. Click upload.

Known or possible bugs and limitations

edit
  • Pure spaghetti code
  • Might interfere with LuckyRename (much less likely if you don't open the interface of both) because half of its functionality is borrowed from that script, needs to be fixed
  • "pending" status on the usage replacement table does not update if the edit fails
  • As the script does not support "chunked" uploading the maximum file size is 100MB. The actual limit could possibly be lower depending on your connection speed. (if the connection times out before the upload is done)
  • When importing from a wiki other than Wikimedia Commons, if the file name from the originating wiki exists on the target wiki or Commons pages may get messed up. Not very likely to run into in practice, but I need to fix it