Complex sentence: The years 1835--1838 were spent on the South American station, and thereafter she was at Portsmouth for several years before being fitted out as a flagship in 1845 and sent to the Cape of Good Hope for the next two year commission.
Split into simpler sentences: The years 1835--1838 were spent on the South American station. Thereafter she was at Portsmouth for several years before being fitted out as a flagship in 1845 and sent to the Cape of Good Hope for the next two year commission.