Target Audience: Full-stack developers, engineering leads, and startup teams migrating applications, databases, and background workloads following Railway's disclosure that customer environment variables were exposed and builds were paused.
Railway disclosed an unauthorized access incident where customer environment variables were exposed, resulting in paused builds across the platform.
When a PaaS provider confirms that customer environment variables were exposed, your problem isn't just downtime—it is an active security liability. Paused builds leave teams unable to ship critical fixes, while exposed environment variables put downstream APIs, databases, and payment gateways at immediate risk.
Whether you need an emergency failover or a secure, permanent home for your workloads, this runbook covers migrating your full stack—Web Frontend, Backend API, PostgreSQL/MySQL/Redis, and Background Workers—with a zero-trust credential rotation strategy.
1. Zero-Friction Parity: What Maps 1:1?
The biggest hurdle in an emergency migration is re-architecting configuration. On Deployxa, Railway's multi-service interconnections work out of the box:
💡 ${{ Postgres.DATABASE_URL }} works natively: Deployxa supports the exact same DAG variable interpolation syntax (${{ Service.Var }}). You do not need to rewrite your application's connection string logic or manually glue service hostnames together.
| Railway Concept | Deployxa Equivalent | Code Changes Needed? |
|---|---|---|
| ${{ Postgres.DATABASE_URL }} | Dynamic Variable Interpolation (${{ Postgres.DATABASE_URL }}) | 1:1 Compatible |
| Nixpacks / Build Detection | Automated Multi-Runtime Buildpack Engine | None |
| Railway Postgres / Redis | Dedicated Isolated DBs with persistent volume storage | None (Restore via pg_restore) |
| Private Service Mesh | Isolated Virtual Project Network | None (Internal DNS resolution) |
| Deploy on Git Push | GitHub Integration & Webhook Deployment | None |
| Worker / Background Job | Standalone Worker Services (No public port required) | None |
2. Step 1: Rotate Before You Paste (Credential Quarantine)
⚠️ ROTATE BEFORE YOU PASTE: With Railway confirming that customer environment variables were exposed, assume every secret and token currently stored in Railway is compromised. Do not simply copy-paste existing keys into a new provider, or you will carry compromised credentials into a clean environment.
The Safe Secret Extraction Order:
1. Source From Local Repositories & CI/CD First: Because Railway's API and CLI may be degraded, locked down, or untrusted, check your local .env.production / .env.local and your GitHub Actions / GitLab CI Secret Stores. These mirrors reflect your production setup without depending on Railway's API availability.
2. Rotate At The Source: Generate fresh API keys for third-party services: Stripe, OpenAI, Resend/SendGrid, Supabase, and AWS/R2 IAM credentials. Revoke previous keys once the new service is live.
3. Provision Fresh Database Passwords: When provisioning your new database on Deployxa, let Deployxa generate a brand-new cryptographic password. Do not reuse your old Railway database credentials.
4. Railway CLI (Secondary Fallback): If Railway's API is accessible and you need to audit what variables you had configured, run:
# Secondary fallback if Railway API responds
railway link
railway variables --service --json > railway-vars.json
# Note: Use this strictly as an inventory checklist of keys to rotate, not values to reuse! 5. Paste New Keys Into Deployxa: In Deployxa, paste the newly rotated key-value block into Project Settings → Environment Variables. Multi-line .env formats are parsed automatically.
3. Step 2: Database Snapshot & Restoration
If your database is stateful, data preservation is priority #1.
Case A: Railway TCP Proxy is Still Reachable
If Railway's external database proxy is responding, take an immediate snapshot:
# Dump the database to a compressed archive
pg_dump -h -p -U postgres -d railway -F c -b -v -f production_backup.dump Case B: If Railway Database Access is Blocked
Use your most recent off-site logical backup (daily S3 snapshots or local dump).
Restoring to Deployxa:
In Deployxa, click New Service → Database → PostgreSQL (or MySQL / Redis).
Deployxa provisions a dedicated isolated database container with persistent volume storage, providing an internal mesh hostname and an external TCP connection port.
Restore your data directly from your terminal using the credentials displayed in your database dashboard:
pg_restore -h -p -U deployxa -d deployxa -v production_backup.dump 4. Step 3: Deploying Your App Services (Zero Dockerfile Required)
Deployxa automatically detects your framework and dependencies using isolated, sandboxed container builds. You do not need to write a Dockerfile unless you already maintain one.
1. Connect Git or Push via CLI
Connect your GitHub repository directly from the dashboard: select repository, branch (e.g. main), and root directory. Alternatively, push directly from your local terminal:
curl -fsSL https://deployxa.com/install.sh | bash
deployxa login
deployxa deploy2. Configure Multi-Service Connections
If your application consists of a Web API, a Background Worker, and a Frontend:
In Deployxa's Environment Canvas, add each service from the repository.
For the Web API: specify your start command (e.g.,
npm startoruvicorn main:app --host 0.0.0.0 --port 8000).For the Worker: toggle off "Public HTTP Ingress" so it runs as a private background worker attached to Redis.
Reference your database dynamically using variable interpolation:
DATABASE_URL=${{ PostgreSQL.DATABASE_URL }}
REDIS_URL=${{ Redis.REDIS_URL }}5. Step 4: Private Mesh Networking (Internal DNS)
On Railway, services communicate using internal hostnames like service.railway.internal.
On Deployxa, every multi-service project runs inside an isolated, private virtual project network. Services communicate securely using clean internal DNS names:
PostgreSQL:
postgres:5432Redis:
redis:6379Backend API:
http://api:8000
Internal traffic never traverses the public internet, avoiding latency, external egress bandwidth costs, and firewall exposure.
6. Step 5: Instant DNS Cutover & Automatic SSL
Once your application build succeeds and passes its health check:
Add Custom Domain: Navigate to Service Settings → Domains and enter your production domain (e.g., api.yourdomain.com).
Update DNS Records: In your DNS provider (Cloudflare, Namecheap, Route 53), point your subdomain or apex via CNAME, ALIAS, or ANAME to cname.deployxa.com. Using CNAME/ALIAS routing ensures your domain benefits from edge routing and DDoS failover without tying your service to a single fixed origin IP.
Automatic SSL Certificates: Deployxa's edge router automatically provisions and renews TLS certificates via Let's Encrypt within seconds of DNS propagation.
7. Hardening Your Architecture Post-Incident
Once your production application is restored, put guardrails in place so upstream platform incidents never become existential crises:
Externalize Your Backups: Automate daily database backups directly to your own AWS S3 or Cloudflare R2 bucket. Deployxa includes native automated cron backup sync out of the box.
Isolate Environment Secrets: Never store root cloud credentials inside an application's environment variables. Use scoped IAM roles with least-privilege policies.
Standby Rollbacks (Blue/Green): Deployxa maintains previous build artifacts in reserve. If a deployment fails or an update introduces a breaking regression, roll back to the previous healthy release instantly with 1 click.
Need Migration Support?
If you are currently migrating workloads or dealing with complex database restorations: