In my current house, I've installed 6 ceiling fans and replaced the one in the master bedroom. 3 in an in-law apartment, and 3 in bedrooms. With all of these, I either had to replace the box that was there or drill a new hole and install a box. I've been using these:
Fan box
Because I have access to the attic. These also allow me to drill a hole for the box using a hole saw, and then take a piece of wood and the box into the attic, mark where the hole goes on the wood, install the box, then install the wood piece between the joists. I also create an air sealed box around this by routing wire through the piece of wood, attaching a second wood piece a short distance away between the joists, spray foaming holes and edges, sealing around the box itself with fire-rated caulking, and any penetrations into the box with the same, filling with insulation, adding a drywall cap (which can be unscrewed for access, if desired).
Those boxes are also old-work compatible, so you can take off the old box for the crappy light fixture in the middle of the room and drill this box in. Some tips: screw the screws in and out of the plastic, and place them at starting depth. This makes it easier to start. Put the box into place and use a screw driver to start the screws into the wood, then back them out again to switch to a driver. Use a socket instead of a Phillips bit.