How to clean up Mattermost team edition on a second server (localhost)?

I want to migrate from Mattermost to Zulip.

When I try to export the data, like this:

user@mattermost:/opt/mattermost/bin$ ./mmctl export create --attachments

This is breaking due to the “soft-deletes” done by Mattermost.

Hence, I wish to remove all posts which point to deleted data. I am planning to use this script to remove all deleted data.

Can I copy the Mattermost MySQL database / config.json and simultaneously start a Mattermost server on my localhost? I do not plan to add any posts, I only want to export the data.

I am using Amazon S3 to store my files and not the local hard disk.

I am planning to skip lines 33-29 and 43-46. I understand this will not delete the files hosted in Amazon S3.

Then on my localhost, I wish to do:

user@mattermost:/opt/mattermost/bin$ ./mmctl export create --attachments

So that the export does not break.

Is this a good plan? Will the “second” mattermost hosted in the localhost cause issues? I am doing this “second” setup so that in case anything goes wrong my live server is safe.