A whale that was buried in a shallow beach grave will be dug up and moved, after authorities caved to public pressure.