Exreplace
Setup
Install EXReplace from Edit > Preferences > Add-ons and enable it. It adds an 'EXReplace' tab to the Compositor's N-panel and a keyboard shortcut in the Node Editor — Shift+E by default. Open the extension preferences to change the key or the Ctrl/Shift/Alt modifiers.
Swapping connections
Passes and naming
EXReplace matches each connection to the target's output by socket identifier first, then by name, then by a built-in alias table — so passes the two node types spell differently still line up (Z to Depth, Emit to Emission, DiffDir to Diffuse Direct and more). If the EXR Image node sits on the Composite layer, it is switched to View Layer first so the per-pass outputs exist. Any pass with no match on the target is skipped and named in the report rather than guessed at.