Will this ceiling fan box replacement work in old work hole?
Pictured is a random one dollar 4" octagon box.  

That is acceptable for a lamp, but won't do at all for a ceiling fan box.  

Since you're rewiring anyway, you'd be better off to spend a latté worth of cost to put a ceiling fan box here and use /3 cable from the switch.  That way the next occupant has a choice about putting a ceiling fan here.  Obviously the last occupant thought it was worthwhile.