In many practical situations, we need to migrate the existing software package to a new programming language and/or a new operating system. In such a migration, it is important to be able to accurately estimate time needed for this migration: if we underestimate this time, we will lose money and may go bankrupt; if we overestimate this time, other companies who estimate more accuracy will outbid us, and we will lose the contract. The formulas currently used for estimating migration time often lead to underestimation. In this paper, we start with the main ideas behind the existing formulas, and show that a deeper analysis of the situation leads to more accurate estimates. Our empirical study shows that the new, more accurate formulas do not suffer from underestimation.