Whether they are stored locally on your own computer or as part of an iCloud backup, which you ought to have, Apple will keep your text messages on your iPhone and include them in its backups. That's fantastic! It's unfortunate, but the backup doesn't include a separate copy of the file that contains all of your communications. Nevertheless, you may reach them via the use of the filesystem.