What happens when you want to move out of a leasehold flat - can you still sell it and move your mortgage to another property?
Yes, if the mortgage is portable (and I'd advise against taking out one which isn't), the new property is surveyed as all right by the lender and the people moving pass the necessary affordability checks if wanting to borrow more.
The snags I can think of from when I was involved in moving a mortgage from a leasehold flat to a freehold house mainly relate to the buyers.
The leases may slow down the process as the buyers' solicitors need to go through extra checks compared to freehold properties, involving management company etc. And if the remaining time on the lease is short, you may need to start the renewal/extension process (which may cost) or accept a lower price.
In general, you cannot move a mortgage to another property. The buyer might assume the mortgage if that is permissible under the terms of the mortgage contract, but if not, "you" pay off the mortgage from the proceeds of the sale and deliver the property to the buyer without any encumbrances such as a mortgage.
In practice, the buyer will be getting a new mortgage on the property in order to pay you the purchase price, in which case the bank that will be lending him the money will pay off your mortgage(s) and impose its own mortgage on the property, and what you will get as the proceeds of the sale will be the purchase price less the mortgage that was paid off on your behalf (less any other expenses of the transaction that are chargeable to you). That is, the new bank will not just hand over the purchase price to you and trust you to pay off the existing mortgage. Also, there can be more fun and games involved if the leasehold is close to expiring, e.g. as happened on a much larger scale with Hong Kong in 1997.
As for yourself, if you are buying another property and getting a mortgage in order to finance the purchase, you will be getting a new mortgage on the property being purchased. "But, but, but" you splutter, "previously, I had a mortgage for £50,000 on the property I just sold, and I now have a mortgage for £50,000 on the property I just bought. How is this any different from moving my mortgage from one property to another, something you said that I cannot do?"
Well, the difference that it is a different mortgage, possibly with a different interest rate and different term (e.g. 25 years instead of the 27 that you had remaining on the previous mortgage) and different monthly payment, and imposed on a different property, possibly with a different number of years before the leasehold expires. And of course, the amount of the mortgage might be different too.
In the meantime, of course, you have had other expenses involved in the two legal transactions (conveyancing) and possibly personal expenses such as the cost of moving house, etc. In short, it is not just a matter of "move my mortgage from one property to another."