- Docs
- API reference
- Migration API
Migration API
REST API of the PikoStack migration service: sources, inventory, plans, waves, jobs, events and job actions.
The migration service listens on 127.0.0.1:8790 inside the converter VM, under /api/v1/migrate. It uses the same bearer-token scheme and error format as the hosting API. Create a token with piko-migrate token; readonly tokens can read and run pre-flight checks, admin tokens can change things.
Sources#
| Method | Path | Purpose |
|---|---|---|
| GET | /sources |
List sources |
| POST | /sources |
Add a source (credentials are stored separately and never returned) |
| GET | /sources/{id} |
Show a source |
| PUT | /sources/{id}/credentials |
Replace its credentials |
| DELETE | /sources/{id} |
Remove it |
| POST | /sources/{id}/probe |
Test connectivity and permissions |
| GET | /sources/{id}/inventory |
VMs with disks, NICs, IPs, power state, owner |
Source fields: name, kind (proxmox, libvirt, virtualizor, esxi, vcenter, hyperv), endpoint, username, tls_fingerprint or ssh_host_key, options, and credentials (password, token, api_key, private_key, host_keys, node_addrs).
Plans and jobs#
| Method | Path | Purpose |
|---|---|---|
| GET | /plans |
List plans |
| POST | /plans |
Create a plan with waves and defaults |
| GET | /plans/{id} |
Show a plan |
| PUT | /plans/{id} |
Update a plan |
| GET | /plans/{id}/jobs |
Jobs in a plan |
| POST | /plans/{id}/jobs |
Add VMs as jobs |
| GET | /plans/{id}/summary |
Counts by state, bytes copied, estimates |
| GET | /jobs/{id} |
Show a job with progress |
| PATCH | /jobs/{id} |
Change a job's mapping or policy before cutover |
| GET | /jobs/{id}/events |
The job's event log |
| POST | /jobs/{id}/preflight |
Run pre-flight checks without changing anything |
| POST | /jobs/{id}/{action} |
cutover, rollback, finalize, cancel, retry, continue, resync |
Create a plan#
{
"name": "Wave plan: web tier",
"max_parallel_syncs": 4,
"max_syncs_per_source_host": 2,
"bandwidth_bytes": 125000000,
"waves": [
{"number": 1, "name": "Pilot", "max_parallel_cutovers": 1,
"window": {"days": [6], "start": "01:00", "end": "05:00", "time_zone": "Europe/Berlin"}}
],
"defaults": {
"cutover": "scheduled", "quiesce": "shutdown", "max_downtime": "15m",
"auto_rollback": true, "keep_source_mac": true,
"probes": [{"type": "tcp", "port": 22}]
}
}
Durations are Go-style strings such as 90s, 15m or 1h.
Add jobs#
{
"jobs": [
{
"source_id": "src_01", "vm_id": "vm-1042", "wave": 1,
"mapping": {
"flavor_id": "<plan id>",
"nics": [{"source_key": "net0", "network_id": "<network id>", "ip_mode": "keep"}],
"owner": "whmcs:1001"
}
}
]
}
method is chosen automatically from the source and the VM's power state; set it explicitly only to force cold.
Policy fields#
| Field | Default | Meaning |
|---|---|---|
cutover |
manual |
manual, auto or scheduled |
quiesce |
shutdown |
shutdown, shutdown_then_off or power_off |
shutdown_timeout |
Time to wait for a clean shutdown | |
sync_interval |
Time between delta rounds | |
ready_delta_bytes |
1 GiB | Delta size below which a job is ready |
max_downtime |
30m | Roll back if exceeded |
auto_rollback |
true | Roll back automatically on failure |
probes |
Health probes after boot | |
verify_timeout |
How long probes may take | |
convert |
auto |
auto, always or never |
keep_source_mac |
true | Keep source MAC addresses |
acknowledged_warnings |
Pre-flight warning codes you accept |
Job progress#
"progress": {"total_bytes": 107374182400, "copied_bytes": 64424509440, "round": 3,
"last_delta_bytes": 52428800, "rate_bytes_per_sec": 118000000}
After a cutover, cutover_started and serving_at give the measured downtime.
Something unclear or wrong on this page? Tell us. © 2026 PikoStack.