External Database (Postgres)

Our database service, Postgres, comes installed, by default, with OpenReplay and runs in a dedicated container on your instance for a lower cost of deployment. If you’re looking for greater scalability or easier operations, you can still use an external Postgres (i.e. AWS RDS or GCP Cloud SQL).

Export existing schema and data

Section titled Export existing schema and data

Note: If you’re starting fresh and haven’t yet installed OpenReplay, then simply proceed with the setup and ignore the following steps.

The local schema and recorded data must now be exported to the external Postgres:

  1. First, backup the local database:
kubectl exec -n db postgresql-0 -- bash -c 'PGPASSWORD=<postgresPassword from vars.yaml> pg_dumpall -U postgres '  > ~/path/to/dump.sql
  1. Install the Postgres client on your OpenReplay instance and ensure it has access to the external database:
sudo apt install postgresql-client
  1. Restore the backup into the new externalPostgres:
PGPASSWORD=PG_PASSWORD psql -U PG_USERNAME -h {RDS_URL} -d postgres < /path/to/dump.sql
  1. Finally, update all postgres variables in openreplay -e and point them towards the external database:
  postgresqlPassword: "changeMePassword"
  postgresqlHost: "postgresql.db.svc.cluster.local"
  postgresqlPort: "5432"
  postgresqlUser: "postgres"
  postgresqlDatabase: "postgres"
  1. Save and quit using :wq for the changes to take effect

If you encounter any issues, please connect to our Slack or check out our Forum and get help from our community.