If you don't have a backup and your songs are scattered across multiple computers, you can use iCloud Music Library to unify your libraries on one computer. Here's how.
Apple's iCloud Music Library service can be great for letting you stream content from multiple music libraries (say, your work Mac's library and home Mac's library) on one computer; even better, you can also use it to consolidate your iTunes library if you're trying to make a manual backup.
What you need to know before downloading
iCloud Music Library stores music you've purchased on any device, uploaded or matched from your Macs, and any subscription content you may have downloaded from Apple Music. It won't store items like PDFs or full uploads of WAV files you may have recorded, however. If you have some of those types of files on a work computer you're trying to consolidate to your home library, you'll need to manually move them to your other Mac.
Purchased, uploaded, and matched music remains yours forever after you've downloaded it — it can't be removed from your library or rendered unplayable. (Purchased music may need to be authorized with your Apple ID, however.) In contrast, Apple Music-branded subscription tracks are only downloadable and playable while you have an active Apple Music subscription; cancel your subscription, and those tracks are rendered inert.You can check to see which songs fall under which categories on your Mac before downloading, and even organize them by type.
If your Mac's hard drive is too small to fit your entire music collection, you may need to move your iTunes Library to an external hard drive.
How to download all your music to your Mac
- Pick the computer you want your canonical library to live on.
- Open iTunes.
- Make sure iCloud Music Library is enabled in iTunes > Preferences > General.
- Select Music from the dropdown menu, and select the Library tab.
- Go to View > Show View Options.
Click on the checkboxes next to iCloud Download.
The iCloud Download status icon (shaped like a cloud) shows you whether those songs are downloaded locally to your Mac or not; if not, you'll see a cloud with a downward arrow. You can download tracks one-by-one by clicking on the cloud icon, or by selecting multiple songs and control-clicking on them, then selecting Download.
Once everything's downloaded to your satisfaction, you can then make a backup of your iTunes Library.
Let us know in the comments.