You can backup iPhone text messages (with attachments) including SMS, MMS, iMessages, WhatsApp, and Vibe using iPhone SMS backup software. You can export iPhone text messages with the software as well.
To access texts from an SMS Backup iPhone, first open iExplorer, then click Explore Backups. From the left column, under the Browse iTunes Backups section, select the backup you want to use. Then within that backup select, Messages.
Restore iphone messages including SMS messages, can be restored whenever you need them. Meanwhile, plenty of third-party desktop apps will offer to export your text messages to a Windows or macOS computer, but be wary of trying too many.