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 Railway | On Oalo |
|---|---|
| Services built from one repo | One app, a Procfile line per service |
| Start command | A Procfile line |
| Pre-deploy command | release: line, run before each release |
| Cron schedule | A scheduler: process, or a scheduled workflow |
| Replicas | One copy per process |
| Variables | oalo env, separate for dev and prod |
| PR environments | The preview, dev-<app> |
| Nixpacks, Railpack, Dockerfile | Buildpacks, 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
webis 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
PORTand everyRAILWAY_*andRAILPACK_*variable. - Rename
DATABASE_URLtoEXTERNAL_DATABASE_URL. On Oalo,DATABASE_URLis always your Base's own Postgres (step 3). Have your code read the new name first and fall back to the old one, such asprocess.env.EXTERNAL_DATABASE_URL || process.env.DATABASE_URL. Then if you move the data into your Base, removingEXTERNAL_DATABASE_URLis 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):
-
Check it.
--checkdoes everything except the write, and reports the tables (rows and size), the extensions and any conflicts. CopyDATABASE_PUBLIC_URLfrom 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 -
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.
-
Copy it. Your Base runs
pg_dumpagainst the database itself:oalo db restore --from-env SOURCE_DATABASE_URL --env prodA file from
pg_dump --format=custom, or plain SQL, works too:oalo db restore shop.dump --env prod. -
Switch with
oalo env unset EXTERNAL_DATABASE_URL --env prod. The live app relaunches, readingDATABASE_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-envnames 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
- In the dashboard, open the app and add the domain under Custom Domain.
- Add the CNAME record it shows at your DNS provider. That proves the domain is yours and gets its certificate.
- Point the domain itself at
<workspace>.oalo.aiwith 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. - 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.
Host code you already have: oalo deploy --new makes an app from a repo on your machine or at a Git URL, how Oalo tells what kind of app it is, and what to add.
How a server app in any language is built, started from its Procfile, sized, health-checked, released with no gap, and rolled back.
Give an app its API keys and settings with oalo env, per env: what is secret, what each kind of app gets, its own token and database, and when changes apply.
Move a running Heroku app to your Base with no gap: the same Procfile, config vars in one file, the database kept or moved, the scheduler, and the domain.
Move a running Render app to your Base with no gap: services into a Procfile, variables in one file, the database kept or moved, cron jobs, and the domain.
Move a running Fly.io app to your Base with no gap: fly.toml into a Procfile, your Dockerfile as it is, secrets, the database kept or moved, and the domain.
Move a running Primcloud app to your Base with no gap: the same Procfile, formation sizes, secrets in one file, the database kept or moved, and the domain.
Sign up, install the CLI, and deploy your repo in a few minutes.