Make sure you've got a good sync and backup on your MacBook, so that you can backtrack if things don't work right.
Open iTunes Preferences, go to the Devices tab, and turn off auto-syncing. This will keep you from syncing until you are sure you want too.
Go to the Store menu and authorize the iMac with your iPad's account. (if you are no longer going to use the MacBook to access your iTunes media unauthorize it. This will save your from using up your 5 computer limit later. If you are going to keep playing your music or other iTunes stuff, leave it authorized.
Connect the iPad to the iMac.
When the iMac warns you that it will erase the data on the iPad it should also offer a Transfer Purchases button. Use that. If it does not, then cancel the dialog, right click on the iPad under the Devices list, and choose Transfer Purchases.
Make sure everything you wanted to save off the iPad makes it into the iTunes library on the iMac before you sync the iPad.