Scrapping it may not be an option. If you have built hundreds of thousands of lines on top of a framework, the cost of a rewrite will dwarf the cost of maintaining the framework yourself. The trick is to choose a framework which you can maintain yourself (sources to every aspect of it which you understand well enough to maintain).