If you erased the previous phone and you didn't sync messages via iCloud, you can check to see if you have a backup made from before you wiped the old phone and restore the backup to your new phone. But in restoring backups, it's all or nothing. So your new phone would be restored to the time the backup was made on the old phone, meaning new texts, etc., will be gone on the new phone.
If you synced messages with iCloud, make sure you turn that on on the new phone. Go to:
Settings > Your Name, Apple ID, iCloud, Media & Purhcases
Tap iCloud
Turn on Messages (and any other services you want to sync with iCloud)
Again, that will only work IF you were syncing messaged previously