While I won’t say that it is not possible, it is tricky because direct SQL updates to the database can potentially cause database corruption and data inconsistency.
If we are to move towards that direction, it has to be tested on a staging environment and do it on a single post first since we are manipulating the data.
I attempted this on my end. I pulled the data of the posts that I want to move from the Mattermost team’s Town Square (for example).
SELECT c.Id, u.Username, c.Name, t.Name, p.Message FROM Users AS u LEFT JOIN Posts AS p ON u.Id = p.UserId LEFT JOIN Channels AS c ON c.Id = p.ChannelId LEFT JOIN Teams AS t ON c.TeamId = t.Id WHERE c.Name = "town-square" AND t.Name = "<team_name>";
After that, I ran the UPDATE statement to move the posts from Town Square to the new channel completely:
UPDATE Posts SET ChannelId = "<original_town_square_id>" WHERE ChannelId = "<new_channel_id>";
After clearing the cache of the client, the posts in the town-square is gone and it is moved to the new one. While it may have worked, my concern is just the potential long term effect of this.
Another option that you can look at is the wrangler plugin - GitHub - gabrieljackson/mattermost-plugin-wrangler: Manage Mattermost Messages Masterfully!