I find the easiest way is to remove the calipers, remove the lower arm, remove the track rod end from the hub, undo the hubnut and withdraw the drive shaft from the hub, leaving the driveshaft in the gearbox.
Remove the entire strut and swap the parts over away from the car.