Moving from Fly.io
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.
This moves one running Fly.io app, shop, to your Base. Fly 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
flyctl.
| On Fly.io | On Oalo |
|---|---|
fly.toml | Not read; a Procfile and .oalo/app.json |
[processes] | Procfile lines, all started on the first deploy |
release_command | release: line, run before each release |
[http_service] and internal_port | The web process, on $PORT |
| VM size | A size per process in .oalo/app.json |
| Machine count | One copy per process |
fly secrets, [env] | oalo env, separate for dev and prod |
| Your Dockerfile | Your Dockerfile |
fly ssh console | No shell; release: for migrations |
*.fly.dev | <app>-<workspace>.oalo.ai |
The short way: oalo migrate
In the app's repo, oalo migrate fly works out steps 1 and 2 for you and
shows the plan: the Procfile, the sizes, the health path, the variables and what doesn't carry over (volumes, a Dockerfile with no USER, a fixed port). It changes nothing until you add --apply, and never
prints a value.
oalo migrate fly # the plan
oalo migrate fly --apply # write the Procfile and .oalo/app.json
git add Procfile .oalo/app.json && git commit -m "Move to Oalo"
oalo deploy --new shop
oalo migrate fly --apply # now the app exists: set its variables
It reads fly.toml for the processes, release command, VM size, health check and [env], and asks fly for your secrets' names. Fly never shows a secret's value, so put the values in a .env file and add --env-file .env.fly. The variables go straight to the live app's settings, with PORT and
Fly'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. Turn fly.toml into a Procfile
Your Dockerfile is used as it is. Add a Procfile at the repo's root with
your [processes], and release_command as release:
release: bin/rails db:prepare
web: bin/rails server
worker: bundle exec sidekiq
- With no
web:line,webruns the image's ownENTRYPOINTandCMD. An app with no[processes]needs only arelease:line, or no Procfile. webmust listen on$PORT. A server hard-coded to 8080 (the portfly launchsets up) must read$PORTinstead.- Every line starts on the first deploy and keeps running. Machines that stop when idle become processes that are always on.
Three things your image must do on Oalo:
- Build for arm64. The official base images all do.
- Run as a non-root user (uid 1000). The Dockerfiles
fly launchmakes for Rails and Node already do. - Write only to
/tmp(256 MB). The rest of the filesystem is read-only, so point caches, uploads and logs (a Rails app'stmp/andlog/, say) at/tmpor stdout.
Each process runs as one copy. Give it a size with at least the memory of its
[[vm]], in .oalo/app.json:
{ "sizes": { "web": "medium", "worker": "small" }, "health": "/up" }
The sizes go from tiny (512 MB) to large (2 CPUs, 4 GB). An
[http_service] health check's path goes in health. See
Live server apps.
2. Bring your secrets
fly secrets list -a shop shows names only: Fly never shows a secret's value
again. Get each value from where it came from (your payment provider's
dashboard, say), and write them to .env.fly, a NAME=value per line, with
the [env] section of fly.toml. Then:
- Leave out
PORT,PRIMARY_REGIONand everyFLY_*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.
Variables are secret unless set with --public, and only public ones reach
your Dockerfile's build as ARG NAME. If the build needs [env] values,
load them separately: oalo env set --file env.public --public --env prod.
Secrets never do.
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 your database running and points your Base at it. Your Base reaches it over the internet, not Fly's private network, so:
- A database with a public URL (Supabase, Neon and the like) works as it
is: set its URL as
EXTERNAL_DATABASE_URL. - Fly Postgres listens only on Fly's private network unless you give it a public address. Fly's docs cover connecting from outside Fly.
- Upstash Redis made through Fly is private to Fly's network too. Use a
Redis with a public URL, set as
REDIS_URL.
Anything at *.internal or *.flycast can't be reached from your Base.
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 the old database can go. 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. Writes made after the copy starts
aren't in the copy, so stop them first.
Fly Postgres is private to Fly's network, so your app on Oalo can't use
it in the meantime, and you make the dump on your machine, through
fly proxy. Do this before the app's first oalo deploy --env prod
(step 4), and leave EXTERNAL_DATABASE_URL out of .env.fly:
-
Make a dump and check it. In one terminal:
fly proxy 15432:5432 -a shop-dbIn another, with the database's password and
pg_dump18 or older (the version your Base's tools read):pg_dump --format=custom --no-owner --no-privileges -d "postgres://postgres:<password>@localhost:15432/shop" -f shop.dump oalo db restore shop.dump --env prod --check--checkdoes everything except the write, and reports the tables (rows and size), the extensions and any conflicts. -
Stop writes with
fly scale count 0 -a shop. Your users can't reach the app until it's live on Oalo and the domain points there, so pick a quiet hour. -
Copy it. Make the dump again, now that nothing writes, and restore it:
pg_dump --format=custom --no-owner --no-privileges -d "postgres://postgres:<password>@localhost:15432/shop" -f shop.dump oalo db restore shop.dump --env prod
Then go on with step 4. The live app finds its data at DATABASE_URL from
its first start.
A database with a public URL (Supabase, Neon and the like) needs no
dump: your Base runs pg_dump against it itself. Do this once the app runs
on Oalo against that database (step 4), just before you move the domain
(step 6):
read -rs SOURCE_DATABASE_URL && export SOURCE_DATABASE_URL # paste the URL; it isn't shown
oalo db restore --from-env SOURCE_DATABASE_URL --env prod --check
fly scale count 0 -a shop
oalo db restore --from-env SOURCE_DATABASE_URL --env prod
oalo env unset EXTERNAL_DATABASE_URL --env prod
That's check, stop writes, copy, and switch: the live app relaunches,
reading DATABASE_URL (the fallback from step 2). The URL never goes on the
command line, where your shell history would keep it.
Two things to know:
- 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. Prod asks you to
confirm; in a script, add
--yes. - Until the switch, your app on Oalo uses the old database, 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.fly --env prod
rm .env.fly
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 image, 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.
A preview runs your language's dev server, not the image. An app in a
language Oalo doesn't recognize, built only from its Dockerfile, has no
preview: its first oalo deploy --env prod is where it runs.
5. Without fly ssh console
There's no one-off shell. Migrations belong in the release: line, which
runs before every release. A one-off script against a database you kept
(step 3) can run from your machine.
A scheduled job can be a scheduler: process that runs your language's cron
library (one copy, so every job runs once), or a workflow with a schedule
that calls one of your app's endpoints: see App tools.
Logs: oalo logs --env prod --follow. Rollback: oalo deploy --rollback.
6. 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.
- Replace the domain's Fly records (A and AAAA, or a CNAME) with a CNAME to
<workspace>.oalo.ai. 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.
7. Switch Fly off
Once traffic comes to Oalo, stop the app's machines:
fly scale count 0 -a shop
That's easy to undo while you watch the new app. Then fly apps destroy shop, which deletes its volumes too. If you kept Fly Postgres (step 3), it's
its own Fly app: leave that one running. If you moved the data into your
Base, destroy that one too once you're sure (fly apps destroy shop-db).
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 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.
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 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.