# Separate psql server / migrate

**URL:** <https://meta.discourse.org/t/separate-psql-server-migrate/163645>\
**Category:** Self-hosting\
**Created:** [September 10, 2020, 3:56pm UTC](https://meta.discourse.org/t/separate-psql-server-migrate/163645 "2020-09-10T15:56:26Z")\
**Posts on this page:** 2\
**Page:** 1

## AI-generated summary

In the Self-hosting category, [joa1](/t/-/163645/1) asks about configuring a Docker-based Discourse forum to use a remote database, specifically inquiring about the compatibility of PPAS (Postgres Plus Advanced Server) and whether migrations run via `./launcher rebuild app` or `bundle exec rake db:migrate` will automatically apply to the remote instance. [pfaffman](/t/-/163645/2) confirms that as long as the database settings are correctly configured in the environment variables, the system will function as expected. The necessary configuration includes setting `DISCOURSE_DB_HOST`, `DISCOURSE_DB_SOCKET` to an empty string, `DISCOURSE_DB_USERNAME`, `DISCOURSE_DB_PASSWORD`, and `DISCOURSE_DB_NAME`. This setup ensures that standard maintenance commands, including migrations, are executed against the specified remote server.

<div class="post-metadata">

**Author:** ![joa1](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@joa1](https://meta.discourse.org/u/joa1)\
**Post date:** [September 10, 2020, 3:56pm UTC](https://meta.discourse.org/t/separate-psql-server-migrate/163645/1 "2020-09-10T15:56:26Z")

</div>

Hello!  
I am building a forum using docker.  
I’m trying to use a remote database, but I have a few questions

1. Is it okay to use ppas (Postgres plus advanced server) ?
2. In this guide \> [Configure Discourse to use a separate PostgreSQL server](https://meta.discourse.org/t/running-discourse-with-a-separate-postgresql-server/46375)  
there is no migration procedure.  
If I run the “./launch rebuild app” or “bundle exec rake db:migrate” on the web server,  
it will the migration automatically performed on the remote database?

I look forward to your prompt reply.

Thanks

---

<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:** [September 10, 2020, 4:17pm UTC](https://meta.discourse.org/t/separate-psql-server-migrate/163645/2 "2020-09-10T16:17:22Z")

</div>

If you configure the DB settings, it’ll do as expected.

```plaintext
  DISCOURSE_DB_HOST: {{discourse_db_host}}
  DISCOURSE_DB_SOCKET: ''
  DISCOURSE_DB_USERNAME: {{discourse_db_username}}
  DISCOURSE_DB_PASSWORD: {{discourse_db_password}}
  DISCOURSE_DB_NAME: {{ discourse_db_name }}

```
