When you buy a new ship a warning that you will lose your cargo would be good (elite has spoiled me with auto cargo transfers). Alternatively transfer cargo. Also I lost my spare parts supply which made me sad.
I don’t think we intended for you to lose cargo / spare parts at all, so let me see if it’s easier to add a warning or to fix that bug. Either way, we’ll make a change.