Pvt. Farmer was captured June 11, 1864 at Louisa Court House during the battle at Trevillian Station. He was sent to Fortress Monroe and transferred to Elmira Prison, N.Y. on July 23, 1864.
He was paroled at Elmira and was received at James River for exchange March 15, 1865.