I find it very bad, if you upgrade your ship, that you do not get the old parts back. In reality everybody would keep old parts an sell ist again.
I agree that this makes work in the game. So whats about a Dissassembling line in Ship Building where you get the parts back but loose some of them or have to feed it with some goods for the work.
After this you can assamble the ship with the new parts an have your old one back. Disadvantage would be the cost of deassembling an the time the ship is in the docks. Perhabs dissassembling takes a week or so - so that its not the best opinion in every case.
The thing I am not happy about my idea would be how to solve the problem - Beginnership → Dissassembling → making money, give it to sb an than leave the game.
A solution could be speacial marked items that are not sellable on the cx / market. But I think in the programming code this could be very difficult to solve