Welcome to TRS
They can just be swapped but with some changes
The 2000 upper and lower intake will need to be put on the 1997 engine, 2000 uses different injectors for the higher fuel pressure(65psi), '97 used 35psi
Also wiring harness and vacuum hoses will match up, most wiring and vacuum hookup is on upper and lower intake.
The Cam sensor/synchro will need to be swapped over from the 2000, '97 used 3 wire, '00 used 2 wire, or you can get a new one, they do wear out around 100k miles
1995 to 2000 3.0l Rangers all used the 4R44E 4-speed automatic, so that should be plug and play.
2001 and up got the 5R44E 5-speed
The 2000 Ranger will have PATS(passive anti-theft system) but as long as you don't swap computers the 2000's PATS keys will allow engine to start
Rear drive shaft will be the same, assuming both are super cabs, may have to swap front drive shaft for transfer case output
2000 Rangers used PVH(pulse vacuum hubs) for 4WD, 1998 to 2000, it was not a great system, if your 1997 has manual hubs they won't fit the 2000, AVM rugged ridge are the only manual hubs that worked for PVH setup
You can read here on the differences in the 1997 and 2000 3.0l Vulcan engines:
http://www.therangerstation.com/tech_library/3_0-build.shtml
Internally there were changes, but won't effect the swap.
I would put a label in engine bay to remind you it is a 1997 3.0l engine for future reference if you need internal parts
And as another heads up, in some states you are not allowed to put an older engine in a vehicle, i.e. the 2000 Ranger engine can only be swapped with a 2000 or newer engine, so HIDE that label if you live in one of those states, lol.