what are the mining processes used to obtain magnesium