1) You will need to dig our the pin from the flash hider and the FH will be trashed. Mine was.
2) Either press or drive the out the pins holding the sight tower. Remove the front sight.
3) You will need a barrel nut tool to remove the barrel nut. Also need a vise and upper receiver clamshell holder.
4) grease the threads on the new receiver and assemble using a torque wrench to get the minimum 35lbs on the barrel nut.
5) reassemble the sight
6) put a new FH on and drill/pin/weld to barrel (need a welder, silver solder or take it to someone that can)
All that said, it depends on what tools you already have and if you want to go through the above steps to change to a flattop upper. Unless you already have all the tools (including the vise), it will be less expensive to just buy another upper in the configuration you want.
If it were me, I'd keep what you have and build up or buy another upper in the configuration you want.