Compass set and calibration questions

Hi, I am using Pixhawk autopilot on my quadcopter. Everything is good with flying except the compass calibration, it’s not convenient to calibrate compass by moving the whole copter, I am thinking about just rotating the external compass sensor. Meanwhile I will set to use only external compass, turn off the internal onboard compass!
I don’t know if this idea is workable.

No it absolutely, most positively won’t work. I am 99.9% sure the on-board compass calibration needs to know the orientation of everything to do the cal. You can try it, but if things aren’t working right the calibration will fail. Try and see. Bee sure and test if it actually works before flying.