How do I import messages from another PostgreSQL database?

For feature requests, please see: https://mattermost.com/suggestions/.

For troubleshooting questions, please post in the following format:

Summary
inserted values into channels table but channel and posts not showing up

Steps to reproduce

insert into channels (id, createat, updateat, deleteat, teamid, type, displayname, name, header, purpose, lastpostat, totalmsgcount, extraupdateat, creatorid,schemeid,groupconstrained,shared,totalmsgcountroot,lastrootpostat)
values(‘uniquechanneldidnumber’,‘1525065333677’,‘1525065557907’,‘’,‘teamidnumber’,‘O’,‘dname’,‘sometext’,‘more text’,‘describe some text’,‘1691372178880’,‘9828’,‘1525830359132’,‘uniquenumberid’,‘’,‘’,NULL,‘8468’,‘1691372178880’);
verified that entry can be found

select * from channels where name=‘dname’;

Expected behavior
Channel to appear in MM

Observed behavior
when dumping data from the previous DB, some channels were missing from the channels table, I can still see the posts in the postgres with the channelid. I recreated the channel entry in the channels table but the channel is still not showing up in mattermost.

running MM server 7.10.5
Postgres 15

I figured this out, the MM community seems quiet. The channels were added but the members were somehow removed from the channels thus it didn’t show up in the side bar. I was able to join the channels using browser url to point directly to the channels.

Something interesting I found was that private channels were also open to joining, it just said you were not invited to this channel, do yo uwnat to join anyway. Click yes and I’m in.

This could mean that anyone could go around guessing URLs to gain access to channels they aren’t supposed to be in