Making 2-methoxybenzoic acidWatch
From benzoic acid.
Diazotization. Cool to <5ºC add cold sodium nitrite/HCl mix slowly.
Allow to warm to room temperature.
This gives a mixture of o and p hydroxybenzoic acid that must then be separated, probably by column chromatography.
oooh you wanted methoxy not hydroxy!
OK, from the hydroxybenzoic acid add strong base. eg NaOH in ethanol. This gives the ion of the carboxylic acid group and the hydroxyl.
Add methyl iodide, which will methylate both ions.
Then heat with dil HCl to hydrolyse the ester group to the carboxylic acid group again.