Migrating config.json to DB

I followed the Configuration in the Mattermost Database instructions but at the very end, the command SELECT * FROM Configurations WHERE Active = 1; fails with ERROR: relation "configurations" does not exist

Observed behavior
I used my GUI client to connect to the DB and sure enough there is a table called configurations with 2 records. One record has a null value for active, while the other has the string t. Strangely, I cannot change the value t to 1. Even stranger, from the CLI, SELECT * FROM configurations; yields the same error message as above. But I see it in my GUI client!

Any help would be appreciated. Many thanks in advance to all!

Hi, @mmadmin

Can you please provide more details to your environment so I can confirm if this is a bug or something else?

  • Mattermost Server version

  • Database type and version

Instead of using lower case, can you provide the output of the SELECT * FROM Configurations from your GUI client?

Also, can you also share the content the following by removing sensitive information such as password?

  • /opt/mattermost/config/mattermost.environment
  • mattermost.service
  • bin/mattermost config get SqlSettings.DataSource

Did you run the command bin/mattermost config migrate as the mattermost user?

Hi there @ahmaddanial, thanks for your help. Here you go:

  1. Mattermost Version: 5.36.0

  2. Database Schema Version: 5.36.0

  3. postgres v10

  4. from GUI, SELECT * FROM Configurations returns the 2 aforementioned records (of course the value column is a big json, not shown in the screenshot):

  5. cat /opt/mattermost/config/mattermost.environment:

  1. cat /lib/systemd/system/mattermost.service


  1. Result of bin/mattermost config get SqlSettings.DataSource run as mattermost user:
    SqlSettings.DataSource: "postgres://mmuser:redacted@"

  2. I did indeed run the bin/mattermost config migrate command as mattermost user.

Thank you so much!

@streamer45 @agnivade Could this be a regression?

I think the documentation assumes a MySQL deployment.
The equivalent query for PostgreSQL would be:

SELECT * FROM configurations WHERE Active = 't';

Looking at the provided screenshots everything looks in order.

1 Like

Ah, thank you for the assessment. Iā€™m more used to mysql, so the t threw me off. I guess the documentation could use a bit more clarification between mysql and postgres (it already does so for most all the steps). But it puzzled me as I wanted to verify the migration was successful. Thanks again!