Remodeling ceiling fans

The best news:
Replacing an existing light fixture with a fan can be 
a simple, one-day task since the wiring is already in place.

However—and this is very important—you often can't just hang the fan from the existing electrical box, unless the original install used a really strong junction - rate to support a ceiling fan or large chandelier

 A common plastic box is simply not strong enough to support the added weight and vibration of a fan. Presuming you don't have access to the ceiling fan from above, you must either use a specially rated hanger and box to mount the fan between joists or screw a fan-rated "pancake" box directly to a ceiling joist.

If you're installing a new electrical box, fasten it to a ceiling joist or a 2 x 4 wood brace between two ceiling joists. If there isn't a suitable joist or brace available, but you have access to the framing through the attic, add a brace that can support the fan.

The other option is shown in this photo from the SF Chronicle: installing an expandable ceiling fan hanger bar and electrical box. A hanger bar for "new work" fastens to the joists with screws. You need access to the joists — such as from the attic — to install it. You can install a hanger bar for "old work" from below the ceiling by fitting the bar through the rough opening. Extend the bar until it wedges securely between two joists.  The new electrical box must be grounded or attached to a ground wire in the ceiling.