Before installing a ceiling fan make sure that you follow the portion of the electrical code that requires that you use a fan rated outlet box that will support the extra weight and the motion associated with a fan.
Retrofit junction box ceiling.
Replacement of old style ceiling electrical box.
An old work box is designed to be installed after the fact on walls that are already finished.
Installing a light fixture or outlet in the ceiling requires an electrical junction box to hold the wire connections and the fixture or device.
Do it carefully so as to not damage the existing wiring.
They are often used in situations where you are adding outlets or extending an existing circuit in a room that is already finished.
Buy an old work electrical box.
Turn off the power.
Typically for new construction you d use an insulated and sealed box.
Any disturbance to the wires could cause the insulation to break off.
You will need to remove the old pancake junction box.
Often wiring from that era of home construction now has dry brittle insulation on it.
Typical cold climate construction.
Learn how to retrofit a ceiling fan electrical box.
Installing a ceiling electrical junction box.