GuidesImports & Migrations
Migrate from Railway
Move a Railway Postgres database into CapyDB.
Get the source connection string
In the Railway dashboard: open the Postgres service → Variables tab. Railway exposes two URLs:
DATABASE_PUBLIC_URL— routed through the TCP proxy (*.proxy.rlwy.net:<port>), reachable from the internet. This is the one you want.DATABASE_URL— the private-network URL (postgres.railway.internal), only reachable from inside Railway. CapyDB cannot use it.
postgresql://postgres:password@yamanote.proxy.rlwy.net:12345/railwayRailway-specific caveats
- The public URL goes through Railway's TCP proxy and bills egress; a one-time logical copy is normally trivial, but a very large database costs what it costs.
- If the service has TCP proxy disabled (private-only networking), enable a public endpoint temporarily for the import, then disable it again.
- The default database is literally named
railway— the import recreates the CapyDB project database under its own generated name; your app does not care, the URL carries the name.
Preflight
capydb import preflight --source-url "postgresql://postgres:password@....proxy.rlwy.net:12345/railway"Railway Postgres images are recent majors with few default extensions, so the version and extension checks usually pass; size against the plan is the one to watch.
Import
Pause writers, then:
capydb import --source-url "postgresql://...proxy.rlwy.net:12345/railway" --recreate --waitAfter the import
- Spot-check sequences.
\dxfor extensions.ANALYZE;- Cut over env vars in your Railway app services (or wherever the app now lives), deploy, and watch Observability.