All you need to do is call customer service and ask for a number migration. Your old contract will end immediately that your number is migrated and a final bill generated, which will include a 30 day cancellation fee.
I have no affiliation whatsoever with O2 or any subsidiary companies. Comments posted are entirely of my own opinion. This is not Customer Service so we are unable to help with account specific issues.