That's true. You're truck would never make a legal California registration. The vehicle will have to be inspected and they will find the frame VIN and match it to the dash VIN and see it doesn't match. Even worse, how will you explain a 2wd VIN to a 4wd vehicle? So long as you keep the truck, it should never be a problem. If you move out of state, you might consider checking the state you're going to. In OK, you'd be fine too.
I don't care to admit it publically, but I've got a similar situation myself. However, it was C20 to C20 and I do still have the frame the VIN plate came from, and do fully intend to re marry that VIN plate to that frame someday.
For the OP, if he's just doing a Cab swap, keeping the same VIN to the same frame, if he's quiet about it, noone will ever know the difference since VIN #'s are not stamped into the cab sheetmetal. Just do it in a way that you keep the same VIN tag rivets. It can be done, I've done it, and it's tedious. You will have to open up the holes just a hair to get the used rivets back in, and glue the tag down. Inspectors know what the rivets look like and some models and different years use different style or shape rivets. If they aren't year and model correct, it's considered tampered VIN.