You can back up messages on an iPhone to your iCloud account, or sync messages from your iPhone to your Mac.