How to sync iphone music to itunes?

I rebooted my system and I lost all of my music (mixtapes, music I downloaded etc) and the only thing itunes saved was my purchases that I bought, How do I sync the music form my iphone to itunes without "erase and sync"? There's this thing where I can view all the songs on my iphone on itunes and it won't let my sync.

Connect your iPhone to your computer and open iTunes. Make sure your sidebar is not hidden by going to View - Show Sidebar. See your iPhone in the sidebar? Right-click on your phone in the sidebar and select Transfer Purchases.