Moir was born with the grounds of the military prison at Verdun in France on 6 April 1808 the son of Margaret Laing Stenhouse and Dr James Moir (b.1780), a naval surgeon in the Royal Navy, who was captured by the French when his ship sank in the Channel around 1806.
[2] From around 1815 (after the end of the wars), he lived with his family at 21 Blair Street in Edinburgh's Old Town.
[3] He attended the High School in Edinburgh, at that time only a short distance from his home.
[5][6] In 1865 he was elected a Fellow of the Royal Society of Edinburgh his proposer being John Hutton Balfour.
[7] Margaret was the daughter of Margaret (née Dalgleish) Maitland-Heriot and James Maitland-Heriot of Ramornie, a grandson of Charles Maitland, 6th Earl of Lauderdale and Lady Elizabeth Ogilvy (daughter of James Ogilvy, 4th Earl of Findlater).