If your Mac is not ancient it is possible you could run a fairly new iTunes version and then subscribe to either Match or Apple Music (which includes Match). That way pretty much all music you have from any source gets put into iCloud and can be downloaded to your new devices over the Internet from your iCloud Music Library (another term for Apple's music in the Cloud).
For backing up make sure you turn on iCloud backup in Settings.
By the way, Apple is really encouraging people to subscribe to Apple Music instead of Match but Match is still available if you hunt for it.
Subscribe to iTunes Match - https://support.apple.com/HT204146
What is not part of this is videos. That's a whole 'nother post if you need it.
iTunes for Mac: Use your iCloud Music Library to access all your music anytime, anywhere - https://support.apple.com/PH19612
- "If you’re an Apple Music member, or if you subscribe to iTunes Match, your music is stored in your iCloud Music Library, so you can access it at any time, wherever you’re connected to the Internet."
Join Apple Music on your iPhone, iPad, iPod touch, Mac, or PC - https://support.apple.com/ht204930