SwapSQL

Conversion API

Everything the website does is available over a simple REST API — convert dumps from scripts, cron jobs or CI pipelines. API access is part of the Pro plan: generate a key on your account page and pass it as the X-API-Key header.

1. Upload a dump

curl -X POST https://YOUR-DOMAIN/api/convert \
  -H "X-API-Key: sk_..." \
  -F direction=mysql2pg \
  -F [email protected]

# → {"job_id": "1f3c…", "status": "queued"}

direction is mysql2pg or pg2mysql. Plain .sql, gzip .sql.gz and pg_dump custom format are accepted.

2. Poll the job

curl https://YOUR-DOMAIN/api/jobs/JOB_ID

# → {"status": "done", "report": {"tables": 12, "rows": 84210, …},
#    "download_url": "/api/download/JOB_ID"}

Statuses: queued → running → done | failed. On failure, error contains a human-readable message and report.error_detail the engine log tail.

3. Download the result

curl -OJ https://YOUR-DOMAIN/api/download/JOB_ID

Live migration (server-to-server)

curl -X POST https://YOUR-DOMAIN/api/live/convert \
  -H "X-API-Key: sk_..." -H "Content-Type: application/json" \
  -d '{
    "direction": "mysql2pg",
    "source": {"host":"old-db.example.com","port":3306,"db":"shop","user":"reader","password":"…"},
    "target": {"host":"new-db.example.com","port":5432,"db":"shop","user":"writer","password":"…"}
  }'

Credentials are used only for the duration of the job and are never written to disk. Tables with matching names in the target are replaced.

Limits