It’s common for many people when selling their home to use the proceeds from the sale to discharge or pay off their mortgage loan. If you have a fully open mortgage you can discharge it at any time without penalty. However, if it’s a fully closed mortgage then discharging it may require you to pay substantial penalties. This is often in an amount that is equal to several months interest payments.
There are ways to avoid these penalties such as taking a portable mortgage with you when you sell your present home and applying it to the home you buy. Depending on your specific sales objectives you may be able to time the sales completion to coincide with the end of the mortgage term.