If the physical connector/pin order is ever the issue, but you know the fan is electrically compatible, you can also use a very small, flat screwdriver to press down on the exposed, angled parts of crimped pins on the new fan's plug, then firmly (not with excessive force that'd rip anything, of course) pull them out. Repeat this with the original fan, taking a picture or making note of the pinout you want, and then just shove the pins of your new fan into the desired holes in the original's plug, with the bent metal parts facing into the rectangular holes like before, effectively swapping the plugs.
It might sound fiddly, but it's nondestructive, reversible, clean, and requires no soldering. If you prefer, you can also re-pin one of the adapters and not the fan itself, in case you need more slack, or to simplify future fan replacements.