Discourse has rake tasks for importing and exporting categories and groups: https://meta.discourse.org/t/administrative-bulk-operations/118349#exportimport-categories-10. I don’t believe this could be used to export group PMs, but it would handle importing/exporting group members and group activity that occurred in regular categories.