Deploy PostgreSQL Migration Service

Migrate data from a standalone Postgres instance to a cluster

Deploy PostgreSQL Migration Service

Just deployed

This template deploys a script which migrates your Postgres databases from a standalone instance to a Highly Available Cluster.

Optionally, it can also enable replication between the Standalone and the Cluster, to facilitate an incremental migration.

How to use

Deploy this template into the Railway project that contains the standalone Postgres instance and the Postgres cluster. If needed, you can deploy a cluster from the HA Postgres template.

Set the required variables:

  • PRIMARY_URL - URL of the primary node in your cluster. If deployed from the HA Postgres template, it is likely pg-0 but you can check by querying show pool_nodes; using psql against the cluster (via PgPool).
  • STANDALONE_URL - URL of the standalone Postgres instance.

You can either hardcode the values, or use reference variables.

Enable replication

The script can optionally enable replication between the Standalone and the Cluster, to facilitate an incremental cutover to the Cluster. To leverage this function, you should set the required environment variables for enabling replication:

  • ENABLE_REPLICATION - Set to "true" (lowercase)
  • RAILWAY_API_TOKEN - Your Railway API token. Required to restart the Standalone instance to apply the required configuration.

Template Content

More templates in this category

View Template
RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set
S3-compatible object store, keys and public URL preset, volume kept

SuperSlowSloth
0
View Template
TimescaleDB
A PostgreSQL-based time-series database for analytics on Railway.

Rakit
1
View Template
Garage S3 Storage
Ultra-light S3 server: fast, open-source, plug-and-play.

PROJETOS
8