FreeYourMusic is a paid app available for Android, iOS, Windows, Mac, and Linux that will transfer your data between Apple Music, Spotify, YouTube Music, Deezer, Pandora, Tidal, Soundcloud, and at least a dozen other streaming apps. It also lets you back up and store some of your data locally on your device.
FreeYourMusic’s backup and transfer tools cost $15, but that’s a one-time purchase that grants you lifetime access on all supported devices and streaming apps.