Per CARB, an engine may be changed/upgrade only to an engine that produces lower emissions. In this particular case it appears the later model diesel engine might fit this criteria, however only a smog check referee can make a final determination.
All emission components belonging to the lesser polluting engine will need to be installed along with the engine, and all emission parts belonging to the old engine, removed. After the engine change is complete, the vehicle will need to be inspected by a California State Referee. They will conduct a smog check.
The Referee will ensure that the engine change was done properly and the vehicle passes smog inspection. If all is well they will issue the vehicle a BAR label which will be placed on the vehicle's chassis. It will be an indication that the vehicle is California legal, and subsequent smog inspections can be performed at regular smog check stations.
You may contact the State Smog Check Referee Office at (800) 622-7733.