When you activate your iPhone in iTunes you get the option of migrating your number. If you're already with O2 it just asks for your existing number, if you're with another provider it will ask for a PAC code.
Apart from handing over your credit card you do nothing in the O2 shop.