# How do I get database connection info?

**URL:** https://meta.discourse.org/t/how-do-i-get-database-connection-info/339634
**Category:** Support
**Tags:** sql-query
**Created:** [December 1, 2024, 2:15pm UTC](https://meta.discourse.org/t/how-do-i-get-database-connection-info/339634 "2024-12-01T14:15:31Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ScrapBlox](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scrapblox/32/554981_2.png) [@ScrapBlox](https://meta.discourse.org/u/ScrapBlox)
#### Post date: [December 1, 2024, 2:15pm UTC](https://meta.discourse.org/t/how-do-i-get-database-connection-info/339634/1 "2024-12-01T14:15:31Z")

</div>

I have a discourse install using docker and I was wondering how do I find/connect to the database connection information like (username,db,password), Thanks in advanced! ❤

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 1, 2024, 2:24pm UTC](https://meta.discourse.org/t/how-do-i-get-database-connection-info/339634/2 "2024-12-01T14:24:44Z")

</div>

What problem are you trying to solve?

You can get to postgres like

```plaintext
./launcher enter app
su - postgres
psql

```

You can use the [data explorer](https://meta.discourse.org/t/32566?silent=true) plugin to do queries from the UX.

I think the user is discourse and allows connection from within the container.

---

<div class="post-metadata">

### Author: ![ScrapBlox](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scrapblox/32/554981_2.png) [@ScrapBlox](https://meta.discourse.org/u/ScrapBlox)
#### Post date: [December 1, 2024, 2:37pm UTC](https://meta.discourse.org/t/how-do-i-get-database-connection-info/339634/3 "2024-12-01T14:37:17Z")

</div>

I was trying to get the database connection information like username and password so I could connect from an external source but I don’t know how to get the connection info.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 1, 2024, 3:11pm UTC](https://meta.discourse.org/t/how-do-i-get-database-connection-info/339634/4 "2024-12-01T15:11:32Z")

</div>

The way to do that is usually to use the API or the [data explorer](https://meta.discourse.org/t/32566?silent=true) plugin.

It’s possible to enter the container like I said and add a user and then open the port on the app.yml, but that’s usually not recommended.

What problem are you trying to solve by connecting from an external source?

---

<div class="post-metadata">

### Author: ![ScrapBlox](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scrapblox/32/554981_2.png) [@ScrapBlox](https://meta.discourse.org/u/ScrapBlox)
#### Post date: [December 1, 2024, 5:16pm UTC](https://meta.discourse.org/t/how-do-i-get-database-connection-info/339634/5 "2024-12-01T17:16:08Z")

</div>

> [@pfaffman](#):
>
> What problem are you trying to solve by connecting from an external source?

I’m looking to migrate my forum from discourse to XenForo for reasons of it being lighter/cheaper to run/host. (Don’t get me wrong discourse is still great software love what was made here)

Running the Discourse to XF importer needs postgresql info..

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 1, 2024, 8:22pm UTC](https://meta.discourse.org/t/how-do-i-get-database-connection-info/339634/6 "2024-12-01T20:22:02Z")

</div>

Then just get a database dump and restore it to another postgres server.
