Every component replacement / exchange / repair is considered a repair of the original aircraft. The original aircraft, and this is to be seen as the fuselage, will maintain the SN until scrapped as a total.
During the scrapping individual parts may be selected to gain a second or even third live on another aircraft. The said part will be identified in the documents as a part coming from the original aircraft.
This has been, in certain circumstances, a major issue in the past as crashed or wrecked aircraft parts have been illegally (no valid labeling) sold and subsequently fitted to aircraft.
Documentation is a challenging job, not easy and it needs a great understanding of the system.