Yes I have some direct experience here in SF. This story will cover the extremes that a story of this kind may go to. Had to get two sets of tenants out for serious capital improvements issues, life and safety issues. The totality will give you a good idea of how things may go. While I am aware of both easier and harder (money wise) stories, I will stick to ours. Also this was nearly 10 years ago, during the downturn. Easier process then, rents were were cheaper and alternative apartments were much more available.
One set, a couple, who we got along we well enough, basically became a typical buyout situation. The buyout cost 28K for 2 tenants. Both sides still had attorneys.
The other set, actually a single tenant, sued 7 business days later, with the help of a tenant's rights organization, for 500K for wrongful eviction. Serious stress beginning. While we already had attorneys and rock solid insurance, it was still an ordeal. The suit went basically away, with relatively small pay outs, the tenant still extracted more money for the buyout.
Total cost for all the process, 105K. Beware.