Will this reaction form magnesium carbonate?
If such a reaction takes place at all it is not very efficient because magnesium hydroxide is not very soluble.

And if you want to get the metallic magnesium neither the carbonate nor the hydroxide will really work.  Both decompose at a relatively low temperature to the oxide, which is then solid up to $\pu{2800\!^\circ C}$.  Convert the magnesium to the chloride and melt that, preferably as a eutectic with alkali metal chlorides.  Then electrolyze the molten salt.  An aqueous solution of magnesium chloride  (or anything else containing magnesium) does not work.