A user can request a full copy of their posts and other data in CSV format via the Export Your Data section of Preferences.
For example here on meta it’s at:
https://meta.discourse.org/my/preferences/account
System will message them with a link to a zip file. The user_archive.csv
contains the post data.