Database Replication

Is there any out of the box or easily supported way to replicate the database to an offsite location for a low RPO data copy? Dumping the whole DB out to a file gets clunky if you want to have a backup taken more than once per day or so.

Any reason why the S3 storage backup facility does not suffice?

It certainly works, but as far as I know it is the same process as local backups - write the entire database out to a file every time the backup runs and then transfer the file to S3. If I want an RPO below 15 minutes, that’s really not a good solution.

You can run an external PostgreSQL instance with the necessary replication for your use case and tell Discourse to connect to that following Running Discourse with a separate PostgreSQL server.

That way it’s all under your control and you can use standard PostgreSQL tools and features.


Oh neat, thanks for the link to that.

Are there any catches with doing this when it comes time to do database upgrades? I know with the default install Discourse typically tries to handle this on its own so would it be necessary to upgrade the database before doing a Discourse rebuild that calls for a new DB version? Or would you need to upgrade the DB after Discourse?

1 Like

You will be responsible for things like keeping that PostgreSQL updated and following the major version we support. If that’s not something you are comfortable with there are hosted alternatives like AWS RDS that make it was easier. Just be aware of pricing as it can quickly become pricier than using our hosting service that can take care of the whole stack for you.

1 Like