And the costs are not just high because of the labour. There's also a high degree of risk. In practice we know less about the running code than we think we do. It usually contains enormous amounts of knowledge about edge cases that will, most likely, be missed on the rewrite and cause trouble.
Economists call this phenomenon "Path Dependency" and it's all around us.
http://en.wikipedia.org/wiki/Path_dependency
And the costs are not just high because of the labour. There's also a high degree of risk. In practice we know less about the running code than we think we do. It usually contains enormous amounts of knowledge about edge cases that will, most likely, be missed on the rewrite and cause trouble.