Ive not traded any ships yet in beta but from PB you get 90% back from the ship value. let it be upgrade or downgrade.
If you have equipped your eagle whit weapons or other stuff. sell them off first. those items wont count toward the ship value. And you will loose all your upgrades and money you spent on them.
Just visit a station (shipyard) that sell a sidewinder.