It depends on the size of the software and business complexity. Usually, some critical improvements can be done within the first-two months (DB optimization; UI face lifting). It can cost around $10 000 - $30 000 and it can save up your time. A full modernization will most likely take 6-12 months of engineering work, and will cost $50 000 - $200 000. For large scale enterprise projects, this process can be longer and more expensive.