If you wish to travel to the United Kingdom to get married or enter into a civil partnership, you will need a visa. The two partners will need to apply for a Marriage Visitor Visa.
If you want to live in the United Kingdom permanently, you will need to apply for a family visa if your partner is a British citizen, or has settled in the United Kingdom (called indefinite leave to remain), has resident or quasi-resident status under the EU Settlement Scheme or has a visa as a Turkish worker or businessman.
If you wish to transform a civil partnership into a marriage, you will not need a visa. However, you will need to bring the same documents required to apply for a Standard Visitor Visa, to be shown to officials at the UK border.
The Honorary Consulate of San Marino endeavours to keep the information above updated but strongly recommends checking the UK government website for any eventual changes.