The most common way to avoid sale or division of the farm is by reorganizing business structures to raise funds or to use the land as security for further borrowing to provide a housing/living fund for the non-owning spouse.
Other options such as using income from renewables or other diversification projects to help fund a capital payment and provide a future income stream if this is appropriate.