How did you get the non-purchased music onto the iPhone? If you
used iTunes on a computer, the music should still be in that iTunes
on that computer. If you deleted the music from the computer, you will
have to get the music back into iTunes and thence to your iPhone.
You will only be able to sync with one library at a time. When you try
to sync with another library, the music on your iPhone from the first will be
wiped. You want to get all your music into the same iTunes and sync
Log into the iTunes on the old computer to see if it will let you download
any purchased music that is not in that copy of iTunes. Then sync
your iPhone to that version. Or copy the music from iTunes on the old
computer to the new computer before syncing to the new computer.