User:This, that and the other/For the Common Good/Reverse transfers
It is possible to run For the Common Good in reverse – that is, to transfer files from Commons to a local wiki.
Why would you want to do this? Perhaps a file is about to be deleted on Commons because it is not freely licensed, and you want to keep it on your local wiki as a "fair use" file.
The local wiki in question doesn't even have to be a Wikimedia-hosted wiki. FtCG should be able to upload files to most wikis running a recent version of MediaWiki, so long as the MediaWiki API is accessible from a URL of the form xyz.wikiabc.org/w/api.php
. (If it doesn't work with your site, or if this URL pattern will not work for you, let me know and I'll try to make it work.)
Reverse transfer functionality was added in FtCG version 1.0.5.11.
Setting up reverse transfers
editBecause FtCG was not designed with reverse transfers in mind, there are a few "tricks" to making this work. Things get a bit swapped around, so take care when changing the settings.
- If you have FtCG open, close it.
- Open your "ForTheCommonGood.cfg" file (stored in the same folder as the FtCG executable) in a plain text editor, such as Notepad. At the bottom of the file, add the line
CommonsDomain=xyz.wikiabc
, where xyz.wikiabc is the domain of the target wiki. (The ".org" is automatically added by FtCG.) Then save the file. - Now open FtCG. If the "login" box appears, just click Cancel.
- Click the "Settings" button in the top-right corner. Set the following settings:
- Target wiki (xyz.wikiabc) login details should hold your login details on the target wiki.
- Set the "Local wiki" field to
commons.wikimedia
- Local wiki login details should hold your Wikimedia Commons login details.
- Turn off the "I am an an admin on my local wiki" check box, regardless of any admin status you may hold.
- If the target wiki does not support HTTPS, turn off the "Use HTTPS" check box.
- In the Local wiki data section, load an appropriately customised local wiki data file. It's up to you to write this file!
- You can now perform reverse transfers with FtCG, but you should turn off the "Tag local file with {{Now Commons}}" check box, as it may cause unintended effects. Also be extra-careful to check the generated wikitext on each file you transfer, as it may need significant changes.
To return to normal use of FtCG (transferring files to Commons), simply undo all the changes you made above.
Problems you may encounter
edit- Duplicate
== {{int:filedesc}} ==
headers at the top of the generated wikitext - Replace the
Summary=
line in the local wiki data file withSummary=\{\{int:filedesc\}\}
. Don't forget to reload the local wiki data file after modifying it! - Missing templates
- Make sure your local wiki contains the following templates (or, at least, redirects):
- Template:Information (accepting at least the six parameters
Description
,Date
,Source
,Author
,Permission
andOther_versions
) - Template:Uv (a user link template – copy or import this one)
- Template:Original upload log (on Wikimedia wikis, this template should contain the exact code
{{int:wm-license-original-upload-log}}
; on non-Wikimedia wikis, it should just contain a translation of the text "Original upload log")
- Template:Information (accepting at least the six parameters
- Dates in the original upload log are in English
- Although MediaWiki can localise dates internally, it does not provide a proper parser function/other means for pages to hook into this functionality. Therefore, we have to pick a language to hard-code into the page's wikitext. Since the lingua franca of Commons is English, FtCG uses English in dates. It's not feasible to work around this at the moment.
Transferring between two arbitrary wikis
editYou can even use FtCG to transfer files between any two wikis (e.g. to copy fair use files from one local wiki to another). The "local wiki" is always the source wiki, while the "CommonsDomain" setting in your ForTheCommonGood.cfg file will be the target wiki.
Need help or advice?
editIf you need help with this process, or have feedback, please don't hesitate to contact me.