Prerequisites
- Levelrail installed on the new server and the CLI signed in (
levelrail-cli auth login). - The CapRover login password. It is exchanged for a session token with
POST /api/v2/login(the only non-GET request the importer makes). - The CapRover URL reachable from the Levelrail control plane. For a private address, set
APP_IMPORT_ALLOW_PRIVATE_NETWORKS=trueand pass--allow-private. - Each app’s git repository, or a registry you can push its image to.
What moves
What needs a manual step
- A source for every app. Connect the repository (with credentials for a private one) and run a build, or push an image to a registry and set it as the source.
- Volume contents, by
rsynccommands you run. - Raw host port mappings are not imported. Publish a port in the app settings if it must be reachable.
- Health checks. CapRover has none to import. Add a readiness path here.
What does not move
- Images built on CapRover: there is no recoverable image through its API. Rebuild from source.
- Databases as a feature. CapRover runs databases as ordinary apps or one-click apps, so nothing maps to a managed database. Create a managed database here and copy the data.
- Certificates, DNS records, deploy history, logs and metrics.
captain-definitionfiles and one-click app definitions. Neither has an importer yet. The feature map lists where each CapRover feature lives here.
Steps
1
Dry run
2
Import
levelrail-cli migrate plan --platform caprover --url https://captain.example.com, then add --apply --only ID.3
Give each app a source and build
Connect the git repository or set the registry image on the app, then deploy it. See Importing apps.
4
Move database data
Create a managed database of the same engine, with the same or a newer major version. Then copy:The CapRover database container must publish a port the Levelrail node can reach. Publish it temporarily and restrict it by firewall. Point the app at the managed database and set its connection variable.
5
Copy volumes, check, switch
Databases and the downtime window
The database copy is a full dump and restore with row counts compared, repeatable, with the source read-only. There is no incremental sync. Pause the old app, run the final copy, start the app here, switch DNS. The window is the final copy time plus a restart. Apps without a database and without volumes can move with no outage you would notice. See the downtime table.Domains and TLS
CapRover runs nginx on 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 and letlevelrail-cli migrate cutover tell you when it is low enough. 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.