The directed propulsion of magnetic microrobots through structured environments often requires real-time feedback between external sensors and the applied field. This requirement, however, can be relaxed to enable self-guided propulsion by coupling field-driven motion to gradients in the local environment. We show that rotating fields direct the migration of ferromagnetic spheres up local gradients in the topography of a solid substrate. We quantify the speed and direction of particle migration as a function of the rotation frequency and incline angle. These observations are explained by a dynamic model that describes particle motion through the fluid due to the magnetic torque and gravitational force. We demonstrate how "topotaxis" can direct the simultaneous navigation of multiple particles on patterned arrays of concave bowls and convex domes without knowledge of the particle locations or the surface topography. These results highlight opportunities for designing timevarying fields to achieve other self-guided behaviors conditioned on local environmental cues.