I have tried with both upload.py and imagetransfer.py to get images to English Wikisource where the filename exists at Wikicommons, and fail, being told that the image already exists at Commons.
Example for imagetransfer.py
billinghurst@tools-sgebastion-07:~$ python3 scripts/imagetransfer.py -lang:en -family:wikisource "File:The humanizing of commerce and industry; the Joseph Fisher lecture in commerce, delivered in Adelaide, 9th May, 1919 (IA humanizingofcomm00mussrich).pdf" ------------------------------------------------------------ 0. Found image: [[File:The humanizing of commerce and industry; the Joseph Fisher lecture in commerce, delivered in Adelaide, 9th May, 1919 (IA humanizingofcomm00mussrich).pdf]] ============================================================ The image is already shared on commons:commons. 1 pages read 0 pages written 0 pages skipped
As a wiki admin I have the right reupload-shared—Override files on the shared media repository locally—at the target wiki (enWS) so I should be able to write but I cannot see an option to force this to occur. This is needed to transfer files that cannot be hosted at Commons, and having to delete it first is problematic.
Noting that the use of -tolang; and -tofamily: failed
billinghurst@tools-sgebastion-07:~$ python3 scripts/imagetransfer.py -tolang:en -tofamily:wikisource "File:The humanizing of commerce and industry; the Joseph Fisher lecture in commerce, delivered in Adelaide, 9th May, 1919 (IA humanizingofcomm00mussrich).pdf" Traceback (most recent call last): File "scripts/imagetransfer.py", line 364, in <module> main() File "scripts/imagetransfer.py", line 359, in main bot = ImageTransferBot(generator=gen, **options) File "scripts/imagetransfer.py", line 161, in __init__ self.opt.target = pywikibot.Site(self.opt.target) File "/data/project/shared/pywikibot/stable/pywikibot/tools/__init__.py", line 1475, in wrapper return obj(*__args, **__kw) File "/data/project/shared/pywikibot/stable/pywikibot/__init__.py", line 1125, in Site fam = Family.load(fam) File "/data/project/shared/pywikibot/stable/pywikibot/tools/__init__.py", line 1475, in wrapper return obj(*__args, **__kw) File "/data/project/shared/pywikibot/stable/pywikibot/family.py", line 574, in load raise UnknownFamily('Family %s does not exist' % fam) pywikibot.exceptions.UnknownFamily: Family en does not exist CRITICAL: Exiting due to uncaught exception <class 'pywikibot.exceptions.UnknownFamily'> Especially for imagetransfer which has the specific advertised purpose to move from Commons to fail is counter intuitive.