Transfer data from iPhone with no password to Apple ID
Your question isn't totally clear, so I'm making some assumptions (such as your Apple ID email is still the same and that you're talking about music you've purchased with that Apple ID).

As a starting point, visit iForgot to reset a forgotten password, unlock your account, or recover an Apple ID.

Once you've done that, you can sign in with your new password etc on your iPhone 7 and download any purchases you've made previously. Also, assuming you have a Mac/PC you can also sign in again on iTunes and use iTunes then to sync music etc across.

If I've misunderstood your issue, please clarify your question and let me know.