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

FlagDescriptionDefault
--fromSource: .lift.json path or server IPRequired
--toTarget: .lift.json path or server IPRequired
--toolsComma-separated tool names to migrateAll tools
--as-stagingPrefix domains with staging. in Traefik labelsfalse
--keySSH private key path (when using bare IP)-
--userSSH 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:

  1. docker compose down -v - Stops containers and removes volumes
  2. Orphan container cleanup - Removes any containers matching the tool name prefix
  3. Orphan volume cleanup - Removes any volumes matching the tool name prefix
  4. 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.