it depends on how shallow is shallow. If its under 1" total, just drain as much clear undisturbed water from the tank as you can store in buckets or the like. Then slowly romove rock and coral. And lastly, with only enough water to cover the backs fo the fishes, catch them gently and easily in the low water (versus stressful trapping ni deeper water with rocks that can scratch, etc).
In those remaining few inched of muddier water (now that all fish, rock and inverts have been removed) you can stir the sand, decant the muddy water and use a clean dust pan to scoop the sand out.
Put wet sand in the dry new tank first, then pump or fill gently (spilling or pumping new water into a bucket that fills and overflows so as to not milk up the tank).
if you have deeper sand, same as above but only stir the top 1" of sand, drain and then scoop the sand off in layers (top 1, second 1", third 1" etc) and return in proper order to the new tank to minimize die off of faculties in the living sand at depth.