Install a Support Brace
Watch video of this step.
If you have access from above, you can make and install your own support brace using a length of 2x4 lumber nailed to the ceiling joists on both sides of the box location (Image 2). Position the brace directly above the ceiling box. From below, use wood screws to attach the ceiling box securely to the brace.
If you do not have access to work above the ceiling, you can install an expanding metal brace from below to support the ceiling box and fan. First, remove the existing box, then insert the brace up through the hole and secure it in position by ratcheting the mechanism into place. As the ratchet is turned from below, arms on the brace extend until they contact the ceiling joists on both sides of the hole (Image 3 demonstration). The spikes on the arms anchor securely into the wood. Some braces are available with a ceiling box attached, or you can attach the existing ceiling box to the brace.
This method also may be used to mount a fan on a ceiling where no electrical fixture was previously installed. After a hole is cut in the ceiling, electrical wiring is routed to the hole from a convenient nearby junction box, then the brace and a new ceiling box are installed as described above.