A method for converting a refinery comprising a system containing two hydrodesulfurization units, U1 and U2, into a biorefinery comprising a hydro-HDO/ISO unit for the production of hydrocarbon fractions from mixtures of a biological origin containing fatty acid glycerides, by hydrolysis of the mixture of a biological origin containing glycerides to glycerine and the corresponding fatty acids, hydrodeoxygenation of said acids after removal of the glycerine and subsequent isomerization, whereby the hydrolysis step is carried out by reacting the mixtures of a biological origin containing glycerides with water, without a catalyst, forming a mixture of fatty acids and glycerine, whereby the mixture of fatty acids and glycerine is biphasic and is composed of a denser aqueous phase containing glycerine and most of the impurities present in the starting charge and a less dense organic phase containing fatty acids, whereby the two phases are separated, the glycerine is recovered from the aqueous phase and the acids are fed to the HDO step, wherein each of the hydrodesulfurization units U1 and U2 comprises: - a hydrodesulfurization reactor, for the unit U1, and for the unit U2, wherein said reactor contains a hydrodesulfurization catalyst, - one or more heat exchangers between the feedstock and effluent of the reactor, - a heating system of the feedstock upstream of the reactor, - a treatment unit of acid gases downstream of the reactor, containing an absorber for H 2 S, said unit called T1 in the unit U1 and T2 in the unit U2 and wherein said method comprises: - installing a unit ID, comprising a hydrolysis reactor R id, for hydrolysing said fatty acid glycerides to fatty acids and glycerine and removing impurities, upstream of the unit U1, - installing a connection line LD between the unit ID and the unit U1, for sending the fatty acids to the reactor 1A, - possibly installing a product recycling line for the unit U1, - possibly installing a product recycling line for the unit U2, - installing a line L between the units U1 and U2, which connect them in series, - substituting the hydrodesulfurization catalyst, in the reactor A1, with a hydrodeoxygenation catalyst, - substituting, the hydrodesulfurization catalyst, in the reactor A2, with an isomerization catalyst, - installing a by-pass line X of the treatment unit of acid gases T2 of the unit U2, - substituting the absorber, in the unit for the treatment of acid gases T1, with a specific absorber for CO 2 and H 2 S. - a hydrodesulfurization reactor, for the unit U1, and for the unit U2, wherein said reactor contains a hydrodesulfurization catalyst, - one or more heat exchangers between the feedstock and effluent of the reactor, - a heating system of the feedstock upstream of the reactor, - a treatment unit of acid gases downstream of the reactor, containing an absorber for H 2 S, said unit called T1 in the unit U1 and T2 in the unit U2 - installing a unit ID, comprising a hydrolysis reactor R id, for hydrolysing said fatty acid glycerides to fatty acids and glycerine and removing impurities, upstream of the unit U1, - installing a connection line LD between the unit ID and the unit U1, for sending the fatty acids to the reactor 1A, - possibly installing a product recycling line for the unit U1, - possibly installing a product recycling line for the unit U2, - installing a line L between the units U1 and U2, which connect them in series, - substituting the hydrodesulfurization catalyst, in the reactor A1, with a hydrodeoxygenation catalyst, - substituting, the hydrodesulfurization catalyst, in the reactor A2, with an isomerization catalyst, - installing a by-pass line X of the treatment unit of acid gases T2 of the unit U2, - substituting the absorber, in the unit for the treatment of acid gases T1, with a specific absorber for CO 2 and H 2 S.