We report experimental observation of the conversion of a phase-invariant nonlinear system into a phase-locked one via the mechanism of rocking [G. J. de Valcarcel and K. Staliunas, Phys. Rev. E 67, 026604 (2003)]. This conversion results in that vortices of the phase-invariant system are being replaced by phase patterns such as domain walls. The experiment is carried out on a photorefractive oscillator in two-wave mixing configuration.A model for the experimental device is given that reproduces the observed behavior.