the blocks are the same, I would just swap parts as needed, your old engine mounts will bolt on to replacement engine. their are a few different types of intakes and fuel injectors and fuel rails, also the knock sensor and thermostate and maybe housing you might want to use off your old engine, some years mount the coil pack in a different spots, and the egr tube could be mounted on either driver manifold or passanger manifold, to play it safe I would swap old parts on to replacement engine, I know the crank pully and crank sensor are the same and the cam shaft sensors is the same, make sure you get spark plugs for the new year engine. some years have different spark plugs.
I have replaced the engine in my 1997 with an 2001 engine, and I have an 2003 that I put an 2010 engine in, and all of the blocks have looked the same.