The design of the Apple iPhone allows synchronization with a single computer and a single iTunes library. When you connect an iPhone to a new computer or one that you do not normally synchronize with, you will be presented with a dialog box asking if you want to erase the iPhone’s memory. To avoid losing data on your phone, you can automatically disable synchronization in iTunes and then transfer the contents of the device to the new computer.
Start the iTunes application on your Mac or PC computer.
Go to “Preferences” in the “iTunes” menu on a Mac or the “Edit” menu in Windows.
Navigate to the “Devices” tab at the top of the pop-up window, select the box next to “Prevent iPods, iPhones and iPads from synchronizing automatically” and then click “OK”.
Go to the “Store” menu at the top of the screen and select the “Authorize this computer” option.
Enter your iTunes username and password and click “Authorize.”
Connect your iPhone to your computer using an iPhone USB cable.
Right click on the name of your iPhone in the “Devices” list and select the option “Transfer purchased content”. This will migrate the data from your iPhone to the iTunes library of your new computer.
Press the sync button in the lower right corner of the window to perform an update between the iPhone and the computer.