User blog:SlyCooperFan1/How to Merge Two Files

I've run into many situations where an editor tries to replace an old image by uploading to a brand-new filename instead of just reuploading to the old filename. The obvious solution here is to merge the two images together. I've wondered for years how to merge images, and there's no easy solution available by simply searching. I accidentally stumbled upon the method today, and I wanted to share it with you all in case it might help some fellow admins in the future!

Method
Suppose we have two images. File:Image1.jpg was uploaded on July 1, 2018. File:Image2.jpg was uploaded on July 2, 2018. You want to merge the two together so you don't lose the history, and you want Image2 to be the latest one.


 * Go to File:Image1.jpg and delete it. Yes, delete it.
 * Rename File:Image2.jpg to File:Image1.jpg.
 * Go to Special:Undelete/File:Image1.jpg and restore all of the deleted revisions.

Voila! The page named File:Image1.jpg now has both images showing in the upload history with proper author credit, but Image2 remains the one included on wiki articles.

But what if you wanted Image1.jpg to be the latest upload and Image2.jpg to be the one that doesn't show except in the upload history? Easy, just switch the order around. Delete Image2 first, then rename Image1 to Image2, and restore Image2.

CAUTION: This should only be done if the two file extensions are the same (jpg and jpg, png and png, etc.). I don't think MediaWiki will allow you to rename files to the wrong extension, but even if it does, don't do it -- you'll just confuse other editors!

Why?
Let's use Avengers: Infinity War as an example. Don't worry, no major spoilers here!

Among other incredible characters, we got to enjoy some humorous moments with Drax. Imagine the following scenario: Someone at the Marvel Cinematic Universe Wiki uploads a leaked, low-quality picture of Drax from one scene in the movie. A few weeks later, someone else uploads an official picture of Drax in the exact same scene, this time from an official source in high quality.

If the MCU Wiki admins wanted to give both users credit for the image, but also wanted to use the higher-quality image across the wiki, merging the two images in the above method would be the easiest option to do so.

Honestly, discovering this was mind-blowing to me, since there's no obvious indication you can do something like this. I hope this blog post does the same for anyone else who may not have known about merging files!