Get StartedMigrationMigrate from Railway

Migrate from Railway

This guide walks you through migrating your application from Railway to Zeabur. Railway and Zeabur share a similar Git-based deployment model, so the migration is straightforward.

Before You Begin

  • A Zeabur account.
  • Your application source code in a Git repository (GitHub).
  • Access to your Railway dashboard.

Step 1: Connect Your Git Repository

Since Railway apps are typically connected to a Git repository, you can connect the same repo to Zeabur:

  1. Log in to the Zeabur dashboard.
  2. Create a new project and select a dedicated server (or purchase a new one).
  3. Click Add ServiceGit and connect your GitHub account.
  4. Select the same repository your Railway service uses.

Zeabur auto-detects your project’s language, framework, and build configuration.

Step 2: Transfer Environment Variables

  1. In your Railway project, click on a service and go to the Variables tab. Click Raw Editor to copy all variables at once.
  2. In the Zeabur dashboard, click your service and go to the Variables tab.
  3. Use Bulk Edit to paste all your variables in one step.
💡

Railway uses variable references like ${{Postgres.DATABASE_URL}} to link services. On Zeabur, the equivalent is ${POSTGRES_URI}. Replace Railway-style references with Zeabur’s variable syntax.

Step 3: Migrate Your Database

If you’re using Railway’s database services:

PostgreSQL

  1. Export from Railway: open the Railway database service, go to the Data tab, and use the Dump feature. Or use pg_dump with the Railway connection string:

    pg_dump "your-railway-postgres-url" > backup.sql
  2. Create on Zeabur: click Add ServiceDatabasePostgreSQL.

  3. Import:

    psql "your-zeabur-postgres-connection-string" < backup.sql

MySQL

  1. Export from Railway:

    mysqldump -h railway-host -u root -p railway_db > backup.sql
  2. Create on Zeabur: click Add ServiceDatabaseMySQL.

  3. Import:

    mysql -h zeabur-host -u root -p zeabur_db < backup.sql

Redis

  1. Export from Railway:

    redis-cli -u "your-railway-redis-url" --rdb dump.rdb
  2. Create on Zeabur: click Add ServiceDatabaseRedis.

  3. For most use cases, Redis is used as a cache and can be started fresh without importing data.

Step 4: Migrate Volumes

If your Railway service uses persistent volumes:

  1. Download your data from Railway. You can use Railway’s CLI or access the volume through the service’s shell.
  2. In the Zeabur dashboard, go to your service’s Volumes tab and click Add Volume.
  3. Specify the mount path (must match what your application expects).
  4. Upload your data via the service shell or let the application regenerate it.
⚠️

There is no direct volume-to-volume transfer between Railway and Zeabur. You’ll need to manually export and import the data.

Step 5: Set Up Custom Domains

  1. In the Zeabur dashboard, click your service and go to the Networking tab.
  2. Click Generate Domain for a free .zeabur.app subdomain, or click Custom Domain to add your own.
  3. Update your DNS records:
    • Remove the old Railway CNAME record.
    • Add a CNAME record pointing to the Zeabur-provided target.

Step 6: Verify and Go Live

  1. Push a commit to trigger a deployment, or click Redeploy in the dashboard.
  2. Check the Logs tab to confirm your app starts correctly.
  3. Test database connectivity and all key application flows.
  4. Once verified, switch your production DNS to Zeabur.

Key Differences: Railway vs Zeabur

FeatureRailwayZeabur
DeploymentGit push (auto-deploy)Git push (auto-deploy)
Variable references${{Service.VAR}}${VAR}
DatabasesBuilt-in Postgres, MySQL, Redis, MongoDBDatabase services with the same options + more
VolumesPer-service volumesPer-service volumes
ScalingManual replica countManual resource allocation
Dedicated serversNot availableAvailable (bare-metal options)
TemplatesRailway templatesZeabur Templates
AI servicesNot availableAI Hub for model inference
PricingUsage-based + subscriptionUsage-based, pay for what you use

That’s it. Your Railway application is now running on Zeabur. The two platforms have a very similar developer experience, so you should feel right at home. If you run into any issues, reach out on our community forum.