lift migrate
Migrate deployments from one server to another, cleaning up the source after successful transfer.
lift migrate
Migrate all (or specific) deployments from a source server to a target server. This is like lift clone, but also cleans up the source server after successful migration. Failed tools remain on the source to prevent data loss.
Usage
# Migrate using .lift.json configs
lift migrate --from source/.lift.json --to target/.lift.json
# Migrate using bare IP addresses
lift migrate --from 1.2.3.4 --to 5.6.7.8 --key ~/.ssh/id_rsa
# Migrate specific tools only
lift migrate --from source/.lift.json --to target/.lift.json --tools redis,postgres
Flags
| Flag | Description | Default |
|---|---|---|
--from | Source: .lift.json path or server IP | Required |
--to | Target: .lift.json path or server IP | Required |
--tools | Comma-separated tool names to migrate | All tools |
--as-staging | Prefix domains with staging. in Traefik labels | false |
--key | SSH private key path (when using bare IP) | - |
--user | SSH user (when using bare IP) | onelift |
Difference from Clone
Migrate runs the same 5-phase pipeline as lift clone (Discovery, Backup, Transfer, Deploy, Restore), plus an additional cleanup phase:
Source Cleanup
After successful migration, the source server is cleaned up for each successfully deployed tool:
docker compose down -v- Stops containers and removes volumes- Orphan container cleanup - Removes any containers matching the tool name prefix
- Orphan volume cleanup - Removes any volumes matching the tool name prefix
- Deploy directory removal - Deletes
/home/deploy/<name>/
Safety: Tools that failed to deploy on the target are NOT cleaned up from the source. This prevents data loss when migration partially fails.
Related
- lift clone - Clone without cleaning up source
- lift backup - Per-tool backup with Restic