It should be a straight swap.
The '08 will have a separate Transmission Control Module, outboard from the ECM.
If the '05 also has this (it should), then the harnesses will be the same, and any mechanical differences will be miniscule.
If the '05 doesn't have the outboard TCM, then the wiring harness and plug that it mates to on the trans would need to be swapped out, at a minimum. You'd also want to check if any of the output wires on the TCM-controlled harness referenced a function that didn't exist on the other (non-TCM controlled) trans.
Both are 4WD, so you won't have any issues with output shaft length.
There should be no mechanical differences in the way that they connect to the engine block, shift cable, etc. If you're in there, it might be a good idea to refresh the little plug that connects the shift cable to the trans; the OEM ones fail, so if it looks marginal, just go ahead and replace it.