# Database-level export help needed

**URL:** <https://forum.mattermost.com/t/database-level-export-help-needed/11416>\
**Category:** Troubleshooting\
**Created:** [March 23, 2021, 9:09pm UTC](https://forum.mattermost.com/t/database-level-export-help-needed/11416 "2021-03-23T21:09:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kfitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/kfitz/32/8602_2.png) [@kfitz](https://forum.mattermost.com/u/kfitz)\
**Post date:** [March 23, 2021, 9:09pm UTC](https://forum.mattermost.com/t/database-level-export-help-needed/11416/1 "2021-03-23T21:09:45Z")

</div>

Hi. This question stems from the ongoing issues I’ve detailed in the question on [502 bad gateway errors](https://forum.mattermost.com/t/nginx-502-bad-gateway-errors-after-mattermost-docker-update/11401/11), 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…

---

<div class="post-metadata">

**Author:** ![XxLilBoPeepsxX](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/xxlilbopeepsxx/32/4993_2.png) [@XxLilBoPeepsxX](https://forum.mattermost.com/u/XxLilBoPeepsxX)\
**Post date:** [March 26, 2021, 10:05pm UTC](https://forum.mattermost.com/t/database-level-export-help-needed/11416/2 "2021-03-26T22:05:23Z")

</div>

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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![kfitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/kfitz/32/8602_2.png) [@kfitz](https://forum.mattermost.com/u/kfitz)\
**Post date:** [March 27, 2021, 12:22pm UTC](https://forum.mattermost.com/t/database-level-export-help-needed/11416/3 "2021-03-27T12:22:42Z")

</div>

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.
