You should be able to upgrade while you're on site, they'll essentially apply the cost of your tickets to the AP. Depending on how you purchased the tickets they might also be able to do it ahead of time. Your best bet is to call the number they give here: https://disneyworld.disney.go.com/faq/passholders/annual-pass-ticket-upgrade/
Also - if you're at the parks and decide to apply your current tickets to annual pass make sure you at least have one day left. I had 8 day park hopper and upgraded on my last day to annual, they applied the entirety of my 8 day ticket to annual.
My sister decided to wait and thought about upgrading the day after but no longer had access to the option.
If you are sure you want to upgrade do it the first day to take advantage of the AP discounts.
Register on WDWMAGIC. This sidebar will go away, and you'll see fewer ads.