So moving from VM to BT was rather painful process for me.
I wanted to keep my landline from VM as I move to BT. Having been told it should be fine and what feels like 100 calls between BT and VM trying to figure it out, I eventually solicited the help of a telecoms professional who had contacts in the industry and managed to get the answer from Openreach direct.
Virgin Media and BT allocate area codes slightly differently, my local virgin media exchange will use 01494, but according to BT that belongs to another area according to how they define area codes against locations. It's close-by but fundamentally served by a different exchange. So BT/Openreach said they won't port the number over and will need to allocate me another area code.
They said this will be a thing of the past once my exchange goes to digital voice, but until then they stick rigidly to their area code definitions and won't budge an inch on it. Apparently it has billing consequences too.
So long story short, your premises may be in one area code for VM and another for BT (or other openreach based provider) and unless the exchange you are switching to has digital voice, then you won't be able to port your landline over.
Hope this is helpful to someone in the future and you don't waste time being bounced between VM and BT like a ping pong as they certainly didn't know!
If it's any consolation, I had a former BT number with Plusnet, was told it could be ported no problem "as BT own Plusnet".... Phoned after 14 days to be told by someone else that it couldn't be ported, was passed around a few more times before eventually being told I should not have been told that it could be ported in the first place, some numbers can't be ported etc etc. I gave up in the end, though to be fair they did offer a choice of numbers I could have within the old exchange, but just decided not to use the Digital Voice line at all. Again, to be fair, they did credit my last bill with an apology payment too.