Joel ("On Software") Spolsky might say never. If you have a system that is smelly but working, then rewrites of individual
subsystems lets you evolve the working system into something cleaner without any discontinuity of service.
http://www.joelonsoftware.com/articles/fog0000000069.html