It is not illegal to copy your own music for yourself, whether to move CDs to a music server, make a "mix tape", or just have a backup. The key is that the duplication is for your personal use.
It only becomes technically illegal when you pass the copy (or original) to someone else while keeping one for yourself.
Now, as a practical matter, the used CD market has been active for decades without problem. The record companies have no interest in running down used CD sellers to see if they kept a copy for themselves. The record companies only become interested when they discover mass duplication. The most infamous example was the Napster MP3 "peer to peer" music sharing service back in the late 1990s in which a single file upload could be downloaded thousand of times. This lead to a number of lawsuits which bankrupted the original Napster. (They are a completely different service these days.)
So, if you are only making copies for your personal use, don’t sweat it.
Edit: note the rules are different for commercial video DVDs since that requires one to break the encoded copy protection of the files. This is technically illegal even for personal use, though if you are just doing for yourself (say to copy movies to a personal server) no one is going to waste any time chasing your down. It is again the distribution to many others that stirs the pot.