Obviously zoning is a factor. Depending on location the city might be happy to see you increase the density or it may not be allowed at all. Many parts of the city are undergoing planning changes and each is at various stages of the process. Market Octavia for example was passed by everyone but a suit was filed and it's back on hold.
The Ellis Act would create a different restriction. If would simply not allow you to use the property as a rental property for the next five years. You'd be free to take as long as you liked to perform the conversion, etc. However, while the Ellis Act is more approprioate for your project, its comes with some political pittfalls.
As for the conversion, as Jed noted, zoning will be the first line of inquiry. If the property is already zoned RH-2 or greater, you would be allowed to seek the conversion. You would have to obtain approval from the Planning Commission. If you have Ellis Acted the building, there may be protests from tenant advocates who have, depending upon the neighborhood, fought approvals to improve property that has been Ellis Acted. I sat in a Planning Commission hearing for 3 hours to testify for a couple that wanted to install a garage and roof deck on their North Beach 3 unit building which had been Ellis Acted. Tenant advocates streamed in to testify that the commission should deny the approval because it would encourage further Ellis Acting of other buildings and therefore that violated the Planning Commissions general guidelines for promoting affordable housing. It was a very weak argument, but the commission disapproved the garage in the end. (they said for reasons other than the Ellis Act).
Give the above, a buyout of the tenants would be the politically most advantageous way to regain possession. How reasonable or unreasonable a tenant will be in such negotiations is an unknown until you start the process. It may turn out that a buyout cannot be done for any reaosnable sum and you will be left moving forward with the Ellis Act or OMI.
In sum, your idea is possible, but there are a lot of risks involved with purchasing a property with this as your sole plan in mind. You should be prepared to have a Plan B in place.
Jeffery Woo, Esq.
Sedgwick, Detert, Moran & Arnold LLP
Complex Rental Property Group