dokku config:export dump instead. Read the migration overview first for the flow and the downtime table.
Prerequisites
- Levelrail installed on the new server and the CLI signed in (
levelrail-cli auth login). - An SSH login on the Dokku host whose user can use the Docker socket (member of the
dockergroup, or root). See Migrate over SSH for what is read and what is never done. - The app’s git repository, or a registry image, to deploy from.
What moves
What needs a manual step
- Domains. They live in Dokku’s stored config, which is not read. Add them after the plan with
levelrail-cli apps domains add. - Build. Levelrail builds a Dockerfile with BuildKit, or detects the stack and builds with Railpack. It does not run Heroku buildpacks. See Buildpack apps.
- Procfile process types. The import reads containers, not the Procfile. Check each service after the plan.
levelrail-cli import configreads a Procfile andapp.jsonoffline and proposes anapp.yaml. - Persistent storage from
dokku storage:mount. Named volumes can be copied through the tunnel. Bind mounts and stopped containers use the printedrsynccommands. See Migrate over SSH. - Datastores from Dokku plugins (postgres, mysql, redis and others) are copied with the database copy step below.
- Cron and plugin config are not read.
What does not move
- Dokku’s proxy config, certificates from its Let’s Encrypt plugin, and deploy history. Certificates are issued here on first use once DNS points here.
- Buildpack-specific behavior. Check that the app builds with a Dockerfile or Railpack before the cutover.
Steps
1
Test the SSH connection
--fingerprint it lists the host keys the server presents. Compare one with what the Dokku host reports, then pass it with --fingerprint SHA256:.... The test shows the container, volume and image counts and changes nothing. Use a key made for this move and remove it from authorized_keys afterwards.2
Plan and stage the apps
3
Move images and volumes
4
Set the domains
Add each domain to the staged app, then check it before you change DNS:
5
Copy databases
Create a managed database of the same engine on Levelrail (same or newer major version). On the Dokku host, make the database reachable from the new server and read its credentials:Then copy:Restrict the exposed port by firewall to the new server, and run
dokku postgres:unexpose mydb afterwards. If you would rather use Dokku’s own tools, dokku postgres:export makes a dump you can restore with the restore tools.6
Check and switch
Fallback: env dump for one app
Use this when you have no SSH login to give, or only want the variables. It brings in the environment and nothing else: set the image or repository, port and domains on the app yourself.1
Dump the env on the Dokku host
2
Plan and stage the app
3
Set the image or repository, port and domains
Connect the repository (or a registry image) and set the port and domains on the app, then deploy. Or let Levelrail infer it:
levelrail-cli up from a checkout of the repo. See Getting started.Dokku command map
The commands you used every day, and where they went. Levelrail commands are written without thelevelrail-cli prefix. Rows marked from v0.9.5 are being added on the v0.9.5 release branch and are not in earlier versions. There is no dokku alias in the CLI on purpose: Levelrail calls an API with permissions and approvals, and a Dokku-shaped alias would hide that.
Datastore coverage
Each Dokku datastore plugin maps to a managed database engine, a catalog template you run as an app, or nothing. A managed engine gets generated credentials, backups, restore and the database copy step. A catalog template is an ordinary app with its own volume: move its data with the volume copy in Migrate over SSH and back it up as app storage.
The database copy step handles managed engines only. Catalog templates have no dump and restore step, so stop the source service before copying its volume.
GET /api/v1/database-engines is the live source for engines.
Databases and the downtime window
The copy is a full dump and restore with row counts compared and the source read-only. There is no incremental sync. Pause the Dokku app (dokku ps:stop APP), run the final copy, start the app here, switch DNS. The window is the final copy time plus a restart. A Dokku app that only serves from its image and has no database can move with no outage you would notice. See the downtime table.
Domains and TLS
Dokku’s own proxy owns ports 80 and 443. Point DNS at a new server, or install Levelrail in coexist mode. Lower the TTL to 300 seconds a day ahead. Certificates are issued here on first use once DNS points here. See Domains and ingress.Common problems and fixes
Verify and roll back
Runlevelrail-cli migrate cutover --verify after you switch DNS. It checks the certificate, the health path and DNS.
The copy only reads the old server, so nothing there is changed. To roll back, restart the old app if you paused it and point DNS back at the old server.