Symmetry transformation of the three-dimensional vortex system induced by two-dimensional square pinning potentials