Gojko Adzic has an interesting piece by Eric Evans about replacing legacy systems. In summary, focus on the core domain – the part of the software that brings competitive advantage to the business – and use an anti-corruption layer to interface with the old system.