The way your offline music library and the Apple Music library work together can be a little confusing, and this confusion is exacerbated by the overlap between the matching functions performed by Apple Music and iTunes Match. If you sync your iPhone with iTunes on a Mac and use both iCloud Music Library and Apple Music, how will the locally saved songs and playlists interact with those in Apple Music?

A Tech Advisor forum user identifies the issue:

If I turn off iCloud Music Library, it will delete all the Apple Music content on my iPhone, and I can then sync my iMac stuff on to my iPhone. But when I turn iCloud Music library on again, what will happen? Will it have kept my music and playlists in the cloud, so I can just re-download these? Or will I have to find everything once again?

In this article we'll do our best to explain the way Apple's various on- and offline music services interact with each other, and show how to solve syncing complications. For related advice, read Fixes for common iPhone syncing problems.

Differences between Apple Music and iTunes Match

We'd better clear up a few things here before moving on to the correct syncing procedure.

When you subscribe to Apple Music, the service looks at all the songs on your Mac to see if any of them match songs available in its library - the chances are that a lot of them will. These matched songs can immediately be streamed via your Mac or any other device that is signed into your Apple Music subscription. This service is known as iCloud Music Library.

But iCloud Music Library only works for songs that appear in the iTunes Music library. Many users have a range of remixes, mash-ups and obscure tracks that simply don't exist on the iTunes Store. If you want it to, Apple Music will upload these tracks to the cloud as well, and you'll be able to listen to them on other devices too, but with one caveat: Apple Music places DRM on any of these tracks that you download to other devices, which means that if you end your Apple Music subscription, you won't be able to listen to them any more. (The original music files won't be affected, of course, unless you deleted them.)

Apple's other track-matching service, iTunes Match, does a better job of uploading and storing non-recognised tracks, because it doesn't add DRM. iTunes Match is a yearly subscription (£21.99/$24.99) that also matches your music to the iTunes Store. The tracks it can't identify are uploaded to iCloud and you can then stream them.

Our colleague Kirk McElhearn explains the differences and similarities between these two services in How iTunes Match and Apple Music work together.

Some people subscribe to both iTunes Match and Apple Music, but many will just use Apple Music - and since they won't be able to use iTunes Match's superior track-matching, these users will probably want to find a way to combine Apple Music's tracks with their own songs, stored on an iPhone or Mac. Some people have been asking us if they can sync tracks they own (that don't appear in the iTunes Store) while simultaneously using Apple Music.

We'll sort this out in the next section.

How to sync iTunes and stream from iCloud Music Library

Playlists on Apple Music

The reader above phrased it like this: "If I turn off iCloud Music Library it will delete all the Apple Music content on my iPhone, and I can then sync my iMac-stuff onto my iPhone, but... when I turn back on my iCloud Music library, what will happen? Will it have kept my music and playlists in the cloud, so I can just re-download these?"

Good question. The answer is yes. When you turn Apple Music back on you are asked whether to Replace or Merge your new music with the content already on your iPhone. Choosing Merge gives you all your playlists from Apple Music and doesn't get rid of anything on your phone. And turning off Apple Music doesn't remove anything from your online account.

Turn off Apple Music

Follow these steps to sync music from your iTunes library to your iPhone, and then merge it with Apple Music.

  1. Tap Music and set iCloud Music Library to Off. Tap Turn Off.
  2. Open the Music app and go to Playlists. Notice that you no longer have any playlists, but don't panic. They're still in iCloud.
  3. Connect your iPhone to a Mac using the Lightning cable. Open iTunes and choose the iPhone under Devices.
  4. Choose Music in the sidebar and select Sync Music.
  5. Choose what music you want on your iPhone. We're going to sync music by The Kleptones because we know they aren't in the iTunes Store and we can't stream them using iCloud Music Library. Click Apply.
  6. Now go back and check your Playlists. They've gone (or have been replaced with the ones that you chose to sync). Again, don't worry. They'll be back soon.
  7. Go to Settings on the iPhone. Set iCloud Music Library to On.
  8. Tap Merge. Do not tap Replace.
  9. It'll take a while for your music library to load. Open the Music app, and tap My Music.

Sync with iTunes

Now tap Playlists and you'll see all of the same playlists from before. They are synced with your iCloud Music Library. And the music you have synced from iTunes will appear present and correct on your iPhone.

The important thing is to remember to tap Merge. This merges your iTunes playlists with Apple Music.

Merge iTunes with Apple Music

Are there any limitations to this process? In truth, it's a bit of a faff and you can't sync again with iTunes after you've done it (to add new tracks).

Opening iTunes on your Mac brings up the usual "iCloud Music Library is On" message. So if you want to update the music you've synced from iTunes you'll need to go through it all over again.