# Accessing Postgres Database for Analytics Pipeline

**URL:** <https://meta.discourse.org/t/accessing-postgres-database-for-analytics-pipeline/310045>\
**Category:** Data & reporting\
**Tags:** data-explorer, analytics\
**Created:** [May 30, 2024, 11:44pm UTC](https://meta.discourse.org/t/accessing-postgres-database-for-analytics-pipeline/310045 "2024-05-30T23:44:40Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![mqmenchaca](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@mqmenchaca](https://meta.discourse.org/u/mqmenchaca)\
**Post date:** [May 30, 2024, 11:44pm UTC](https://meta.discourse.org/t/accessing-postgres-database-for-analytics-pipeline/310045/1 "2024-05-30T23:44:40Z")

</div>

Hello all, I didn’t quite find a similar post to this, so here goes:

My org is building out our analytics dashboards (within [Snowflake](https://www.snowflake.com/en/)) and are hoping to integrate the user data we have in Discourse.

Currently, we are self-hosting Discourse on an EC2 instance within Docker. It looks like there a couple of options here:

1. Use AWS Database Migration Service to access the Postgres server hosted on the EC2. This would require exposing the Postgres port (which I don’t believe is configured to be publicly accessible by default) and creating a new Postgres user, but otherwise this seems like a pretty good solution.

- A straight sql dump to an s3 bucket (how backups work in Discourse) won’t work, as SQL isn’t accepted as a data format by Snowflake.

1. Install the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) plugin, write the queries that output the data we want, then run + export resulting data in CSVs/JSONs that we can than import into Snowflake.

- This solution looks to have more steps than 1. above, but would also do the trick and has less of a chance of screwing up the Discourse DB.

I would appreciate input or hearing anyone else’s tales of getting their DB data into an analytics pipeline. Thank you!

---

_[View the full topic](https://meta.discourse.org/t/accessing-postgres-database-for-analytics-pipeline/310045)._
