I think to replace hydroxyl group without affecting carbonyl group, you should change carbonyl group to acetal.
Ex: CH3CHO + CH3OH --(HCl)--> CH3CH(OH)OCH3.
After that, you can do whatever you want because acetal group is passive in reactions, when finishing, you hydrolyzed in acidic solution to regenerate carbonyl group, I think this is important because:
CH3CHO + PCl5 --> CH3CHCl2 + POCl3