Database-level export help needed

Hi. This question stems from the ongoing issues I’ve detailed in the question on 502 bad gateway errors, including the failure of the CLI bulk-export tool. I’ve set up a new environment with a new, clean Mattermost installation, and what I’m hoping to do is a database-level export and import, and I’m hoping someone might be able to help point the way.

The installation I need to export out of is docker-based, and was created through an installation script on a Jelastic-based hosting service. The containers that script created are

mattermost-docker_db_1
mattermost-docker_app_1
mattermost-docker_web_1 

I’m not quite sure how to query the database in the container, and – even more mortifyingly – I’m not at all sure what database user and password the installation script set up.

One additional complication: somewhere in the upgrade process described in the other thread, the database schema seems to have advanced to 5.32.0, while the new installation I set up today is using 5.30.0, so I’m going to need to modify the database as exported to fit the older schema.

Any pointers would be enormously appreciated…

If it is anything like a typical MySQL database, you should be able to access it directly from the command line inside your Docker container. At that point, you would want to use a command similar to the following:

mysqldump -u <database_username> -d <database_name> (include the -p flag if the database user has a password) >> <database_export_file.sql>

You would, at this point, now have a SQL file of your database in a text format, that you can then use at a later point to import the database back into a new location, installation, etc.

1 Like

Thank you! It wasn’t exactly typical, but I managed to get the export and have imported into a new location. I appreciate the help.

1 Like