If you've gotten a new computer or reinstalled iTunes, migrating your iTunes library is easy—unless you've somehow lost it. Luckily, you can get everything off your iPhone without too much of a hassle. Here's how to do it.

Recently, I had an issue with iTunes and ended up deleting my entire library. I still had all my music and apps on my iPhone, but iTunes has no method for syncing back in the other direction. After a bit of searching, I found it was pretty easy to restore everything back to the way it was—I just needed to do a little extra work. Here's what the process entails.

Transfer Your Music and Videos with Sharepod

It's pretty easy to restore songs you've bought from iTunes, but anything you've ripped or downloaded yourself is stuck on your iPhone. So, you'll need a little help to get those other music and videos back into your library. Windows users should check out SharePod, which will transfer music, videos, playlists, voice memos, and even ringtones back to iTunes. Mac users will need Senuti, which is $18.99 if you want to transfer more than 1,000 songs (though the old, free version may still work). For more information on how to use these programs check out our detailed guide to copying music from iOS to your computer.

Apple, true to form, makes it simple to put media and files on your iDevice but the road really…
Read more Read more

Once all your music, videos, and playlists are back on your computer, you can re-sync everything to your iPhone like so:

Plug your iPhone into your computer. Click on it in the iTunes sidebar and go to the "Music" tab. Check the "Sync Music" box and it'll re-sync all or your music and playlists.

Repeat this process with your videos, if you have any.

When you're done, your iPhone will be linked to your new computer, but you'll have all your music back in sync between both.

Transfer Your Apps with iTunes

Now that you've got your music back, the other main thing iTunes is missing is your apps. The problem is, if you try to sync it, iTunes tells you that "All existing apps and their data on the iPhone will be replaced with apps from this iTunes library." Here's how to sync your iPhone with the new computer, while making sure you keep all your apps and their data intact.

Plug your iPhone into your computer. Right-click on it in the left sidebar and choose "Transfer Purchases" from the dropdown menu. This will not only transfer purchased music, but any and all apps you've downloaded from the App Store as well.

Let the apps sync from your iPhone back to iTunes.

When it's done, click on your iPhone in the sidebar, go to the "Apps" tab in the main pane, and check the "Sync Apps" box. It'll warn you that it's going to replace the apps on your iPhone, but don't worry—it actually won't change much. All your documents and data will stay intact.

The one downside is that, when it's done syncing, all of your apps will have been rearranged on the home screen. But, after putting them back in the correct order and folders, your iPhone should be exactly the same as it was before, with all your apps and their data in the right place, and it should sync normally with your new copy of iTunes.

That's it! The process can seem a little confusing at first, and it would be really nice if iTunes did this all for you, but sadly it's still ignoring this very important feature. Hopefully, with these instructions, you should be able to get all your information back into iTunes without losing any data off your phone. Next time, make sure you have a good backup of your computer—that way, you can just restore your old iTunes library in its entirety so everything syncs back smoothly!