Among them was Mr. Kelsay. After failing to find a new buyer for the cows' milk, he and his brother sold their herd to another farm in November 2018, followed the next spring by their remaining calves and the last of their milking equipment.

Today, their 2,100-acre operation, called Kelsay Farms, grows only crops such as corn, soybeans and wheat. They went from 12 full-time employees to one.

Mr. Kelsay said he lost part of his identity when his herd was loaded onto trucks.

"We cried as we watched the cows," he said. "It was like a death in the family. You had to choose to stop life support."

Write to Jacob Bunge at jacob.bunge@wsj.com and Jaewon Kang at jaewon.kang@wsj.com