How do I connect directly to the database to load in data?


(Dave Howard) #1

so in a docker container how would one go about connecting directly to the postgres instance? I would like to import data into the discourse database in bulk but have no idea how to connect to postgres or allow host clients (my machine) to connect via odbc or postgres drivers?


Migrating an old Discourse install to Docker
(Rafael dos Santos Silva) #2

You shall never import direct into Discourse using the database.

You can use our API and write a script that reads from a database or spreadsheet and creates posts, topic or users on Discourse.

For read only use, you can use the Data Explorer plugin, or (in last case) open the port 5432 from the container to the outside world.