Farmers do lose the rights to their land when they are given urban hukou, but that is part of the divine central government intervention I was referring to. It isn’t usually the case that they are migrants, but their land is being “liberated” by a nearby city and their hukou is being changed to urban so that they no longer have rights to that land anyways (they’ll also be given a small apartment, good luck with your new career as a non-farmer!).
This is a bit different from people moving from one place to another, and involves another nuance between urban and rural hukou within the same area.