How can I find a pin-to-pin compatible microcontroller to migrate my project?
There is no software tool which compares the device database for the compatible pinout.
You can start the process by using either the Parametric Search Tool page or Microchip Advanced Part Selector (MAPS) to find a preliminary list of devices, then research the best candidates.
Creating pin-to-pin compatible parts can sometimes be accomplished using the Peripheral Pin Select (PPS) interface available on many Microchip MCUs.