District taxes are a lien on the property on which they are levied, except that if, during the year preceding the date on which the first installment of real property taxes which evidence the charges appears on the roll, any real property to which such lien would attach has been transferred or conveyed to a bona fide purchaser for value, or if a lien of a bona fide encumbrancer for value has been created and attaches thereon, then the lien which would otherwise be imposed by this section shall not attach to such real property and the costs of such charges relating to such property shall be transferred to the unsecured roll for collection. The enforcement of the collection of district taxes may be had in the same manner and by the same means as is provided by law for the enforcement of liens for county taxes.