Motor change

i have a truck it has a vortec 4.8 v8 and i want to change it to a 5.8 vortec will the wiring harness be the same both motors are in 2003 1500 trucks

No such thing as a 5.8L Vortec. I assume you mean the 5.3L engine. The harnesses are the same part, but the ECU will require a PROM specific to the engine and or a proper ECU tune to function correctly.

Nope

There is little to gain here and if this vehicle must be emissions tested, problems are sure to arise…

In addition to the ECU issue I can almost promise you that there’ll be other interface issue with other systems such as the drivetrain and exhaust. This swap would be likely to cost much more than you envision both in cash and aggrevation.

Doable? Yes. With time & money.
Worth it? Nope. No way.

Yes it can be done. You may or may not need the wire harness from the 5.3 but you will need the 5.3 computer. They share a lot of the same sensors (by part #) They share the same o2 sensors and cat. The fuel pump is the same for both. The trans is the same. This is an easy swap. This one of last easy engine swaps. I have looked at doing this swap and may do it myself. I have found a Chevy with a 4.8 with high miles and a like new body and drive train cheap. In my case I will less than 5000. in it when done. I am looking at a 07. I can do all of the work myself.