Moving from Railway

Move a running Railway app to your Base with no gap: services into a Procfile, variables in one file, the database kept or moved, cron, and the domain.

This moves one running Railway project, shop, with a web service, a worker and a nightly cron service, to your Base. Railway keeps serving until your domain points at Oalo, so your users never see a gap.

You need the Oalo CLI, signed in to your Base (oalo login <workspace>), and the Railway CLI linked to the project (railway link).

On RailwayOn Oalo
Services built from one repoOne app, a Procfile line per service
Start commandA Procfile line
Pre-deploy commandrelease: line, run before each release
Cron scheduleA scheduler: process, or a scheduled workflow
ReplicasOne copy per process
Variablesoalo env, separate for dev and prod
PR environmentsThe preview, dev-<app>
Nixpacks, Railpack, DockerfileBuildpacks, or your Dockerfile
*.up.railway.app<app>-<workspace>.oalo.ai

The short way: oalo migrate

In the app's repo, oalo migrate railway works out steps 1 and 2 for you and shows the plan: the Procfile, the health path, the variables and what doesn't carry over (cron, volumes, private addresses). It changes nothing until you add --apply, and never prints a value.

oalo migrate railway            # the plan
oalo migrate railway --apply    # write a Procfile (and .oalo/app.json for a health check)
git add Procfile .oalo/app.json && git commit -m "Move to Oalo"
oalo deploy --new shop
oalo migrate railway --apply    # now the app exists: set its variables

It writes the web: and release: lines from one railway.json; add a line for each worker service yourself (step 1). If it wrote files, it prints the exact git add line for them, and those are what the commit above names.

It asks the Railway CLI for the variables, so link the project first (railway link); --from-app names the service. It reads railway.json or railway.toml for the start and pre-deploy commands. The variables go straight to the live app's settings, with PORT and Railway's own left out and DATABASE_URL renamed to EXTERNAL_DATABASE_URL.

Then carry on from step 3. In step 4 the app and its variables are done, so go straight to oalo deploy --env prod. The steps below say what oalo migrate does, and what's left for you.

1. Write a Procfile from your services

Oalo doesn't read railway.json or railway.toml. Each service that runs your code becomes a line in a Procfile at the repo's root, with its start command:

release: npm run migrate
web: npm start
worker: node worker.js
  • web is the one that gets traffic, on $PORT.
  • The web service's pre-deploy command becomes release.
  • Every line starts on the first deploy; there's nothing to scale up.
  • A service built from a different repo becomes its own Oalo app.

Each process runs as one copy. Give it a size with at least the memory it uses on Railway (the service's Metrics tab shows it), in .oalo/app.json:

{ "sizes": { "web": "medium", "worker": "small" }, "health": "/healthz" }

The sizes go from tiny (512 MB) to large (2 CPUs, 4 GB). See Live server apps.

Builds. A Dockerfile at the root is used as it is. Without one, Oalo builds with buildpacks from your repo's files (Node needs its lockfile committed). A custom build command on Railway goes in your build script.

2. Bring your variables

Write each service's variables to a file:

railway variable list --service web --kv > .env.railway
railway variable list --service worker --kv >> .env.railway

Then edit the file before you load it:

  • Remove duplicates shared between services. One app has one set.
  • Delete PORT and every RAILWAY_* and RAILPACK_* variable.
  • Rename DATABASE_URL to EXTERNAL_DATABASE_URL. On Oalo, DATABASE_URL is always your Base's own Postgres (step 3). Have your code read the new name first and fall back to the old one, such as process.env.EXTERNAL_DATABASE_URL || process.env.DATABASE_URL. Then if you move the data into your Base, removing EXTERNAL_DATABASE_URL is the whole switch.
  • Check for ${{ ... }} references: each needs its plain value.
  • Sealed variables can't be read back from Railway. Get them from where they came from, or make new ones.

You'll load it in step 4, once the app exists.

3. Keep your database where it is, or move it

The simplest move keeps Railway's Postgres and Redis running and points your Base at them. Your Base reaches them over the internet, not Railway's private network, so use their public URLs: Postgres's is DATABASE_PUBLIC_URL in the database service's variables. Set it as EXTERNAL_DATABASE_URL, and the Redis public URL as REDIS_URL. Railway bills that traffic as egress.

Anything at *.railway.internal can't be reached from your Base. Use a public URL for it, or move it too.

Volumes don't come along: a process can write only to /tmp (256 MB), which is emptied when it restarts. Move volume data to object storage or the database first.

Your Base also has its own Postgres, which the app reaches at DATABASE_URL. New tables can go there from day one: see App environment.

Or move the data into your Base

oalo db restore copies the database into your Base's own Postgres, so the app reads it at DATABASE_URL and Railway's Postgres can go (Redis stays at REDIS_URL). Workspace admins can run it, for a database whose dump is up to 10 GB, from Postgres 18 or older, and with room for it on your Base. Your Base reads the database over the internet, so it needs the public URL, DATABASE_PUBLIC_URL. The database service's DATABASE_URL is the private network one.

Writes made after the copy starts aren't in the copy, so stop them first. Do this once the app runs on Oalo (step 4), just before you move the domain (step 7):

  1. Check it. --check does everything except the write, and reports the tables (rows and size), the extensions and any conflicts. Copy DATABASE_PUBLIC_URL from the database service's variables. The first line waits for you to paste it, and doesn't show it:

    read -rs SOURCE_DATABASE_URL && export SOURCE_DATABASE_URL
    oalo db restore --from-env SOURCE_DATABASE_URL --env prod --check
    
  2. Stop writes: stop the services that run your code on Railway. Your users can't reach the app until the domain points at Oalo, so pick a quiet hour.

  3. Copy it. Your Base runs pg_dump against the database itself:

    oalo db restore --from-env SOURCE_DATABASE_URL --env prod
    

    A file from pg_dump --format=custom, or plain SQL, works too: oalo db restore shop.dump --env prod.

  4. Switch with oalo env unset EXTERNAL_DATABASE_URL --env prod. The live app relaunches, reading DATABASE_URL (the fallback from step 2).

Three things to know:

  • The URL never goes on the command line, where your shell history would keep it: --from-env names the variable that holds it. Prod asks you to confirm; in a script, add --yes.
  • It's all or nothing. A clash with a table, view, sequence, type or function already in prod is refused, and the reply names them. So is an extension Oalo doesn't allow. A failed restore leaves prod as it was. See "Bringing data in" in App environment.
  • Your app on Oalo uses the Railway database until the switch, so a write from it during the copy (a worker's, say) is lost too.

4. Deploy it

From your repo's folder:

oalo deploy --new shop

This makes the app from your commits, links the folder to it and starts its preview. Load the variables from step 2 into the live app, then go live:

oalo env set --file .env.railway --env prod
rm .env.railway
oalo deploy --env prod

Every line of the file is set, or none: a line naming a variable Oalo sets (PORT, DATABASE_URL, anything starting with OALO_) refuses the whole file and says which. The preview has its own variables (--env dev), so give it test keys.

Oalo builds the commit, runs release, starts every process and waits for web to answer before it serves traffic. If any step fails, it says why and nothing goes live. The app is now at shop-<workspace>.oalo.ai. Try it there before you move the domain.

5. Replace the cron service

Two ways:

  • A scheduler: process. Add a Procfile line that runs your language's cron library (node-cron, APScheduler, rufus-scheduler, and so on) with the same schedules, in UTC as on Railway. Each process runs as one copy, so every job runs once.
  • A scheduled workflow. A workflow with a schedule can call one of your app's endpoints with a Run a tool step: see App tools and Triggers.

6. Without railway ssh

There's no one-off shell. Migrations belong in the release: line, which runs before every release (and before every preview restart). A one-off script against a database you kept (step 3) can run from your machine.

Logs: oalo logs --env prod --follow. Rollback: oalo deploy --rollback.

7. Move your domain

  1. In the dashboard, open the app and add the domain under Custom Domain.
  2. Add the CNAME record it shows at your DNS provider. That proves the domain is yours and gets its certificate.
  3. Point the domain itself at <workspace>.oalo.ai with a CNAME, in place of Railway's. A root domain (example.com) can't have a CNAME: use your DNS provider's ALIAS, ANAME or flattened CNAME.
  4. Wait for Your app is live at in the panel, usually 5 to 30 minutes after DNS updates. It's served over HTTPS.

An app has one custom domain. To serve both www and the root, add one and redirect the other to it with your DNS provider's forwarding.

8. Switch Railway off

Once traffic comes to Oalo, remove the services that ran your code from the Railway project. If you kept the database (step 3), or Redis, keep the project: deleting it deletes them. Otherwise, railway delete once you're sure. If you moved the data into your Base, that deletes the old copy.

Leaving again

Your code stays a git repo and your data comes out as plain SQL (oalo db dump). See "Undock any time" in Bring your repo.

Related
Try it on your own Base

Sign up, install the CLI, and deploy your repo in a few minutes.

bring your repo