My iPhone won't sync from iMac due to iCloud Music Library. I use Apple Music on my iPhone, and it works fine - I do not use it on my iMac, so that's fine too. But alongside the Apple Music content on my iPhone, I would like to have some of the music from my iMac that is NOT available on Apple Music.

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 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? Or will I have to find everything once again and make my playlists? Will my Apple Music playlists be saved in the cloud for redownload when the button is activated again?

(Question via PC Advisor forums.)

Read next: How to sync to iTunes: Sync your iPhone or iPad with a Mac or PC | Fixes for common iPhone syncing problems

Apple Music and iTunes Match: Similarities and differences

The way that your offline music library and the Apple Music library work together is a little confusing, and this confusion has been exacerbated by the overlap between the matching functions performed by Apple Music and iTunes Match. So let's clear things up 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 subcription, 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) 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.

My colleague Kirk McElhearn explains the differences and similarities between iTunes Match and Apple Music's track-matching service in more detail than this, so take a look at How iTunes Match and Apple Music work together for more info.

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.

See also:

How to play music on the Apple TV

iOS 9 Music guide: How to put music on iPhone or iPad, set up playlists & more

Audio and music reviews

iTunes 12.2 review

Apple Music: 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.

Read next: Complete guide to Apple Music12 top tips for using Apple Music | How to cancel your Apple Music free trial | Apple Music vs Spotify | How to cancel your Apple Music free trial | What are the differences between iTunes Match, Apple Music and iCloud Music Library?

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.

Our most popular iPhone tutorials:

How to jailbreak an iPhone

How to unlock an iPhone

How to back up an iPhone

How to block phone numbers on an iPhone

How to reset, factory-reset, restore or restart an iPhone

How to update to the latest version of iOS on an iPhone

How to take a screenshot on an iPhone