Diamond is a highly desirable material for use in x-ray optics and instrumentation. However, due to its extreme hardness and resistance to chemical attack, diamond is difficult to form into a structure suitable for x-ray lenses. Refractive lenses are capable of delivering x-ray beams with nanoscale resolution. A moulding technique for the fabrication of diamond lenses is reported. High-quality silicon moulds were made using photolithography and deep reactive ion etching. The study of the etch process conducted to achieve silicon moulds with vertical sidewalls and minimal surface roughness is discussed. Issues experienced when attempting to deposit diamond into a high-aspect-ratio mould by chemical vapour deposition are highlighted. Two generations of lenses have been successfully fabricated using this transfer-moulding approach with significant improvement in the quality and performance of the optics observed in the second iteration. Testing of the diamond x-ray optics on the Diamond Light Source Ltd synchrotron B16 beamline has yielded a line focus of sub-micrometre width.