Spirit is a single binary with subcommands for MySQL schema and data operations:
| Subcommand | Purpose |
|---|---|
spirit migrate |
Online schema change tool — applies ALTER TABLE statements to large tables without blocking reads or writes |
spirit move |
Logical table mover — copies whole schemas (or a subset of tables) between different MySQL servers |
spirit lint |
Schema linter — validates an entire MySQL schema against built-in lint rules |
spirit diff |
Schema differ — compares two MySQL schemas and lints the changes |
spirit fmt |
Schema file formatter — canonicalizes CREATE TABLE .sql files by round-tripping them through MySQL |
- Use
spirit migratewhen you need to alter the schema of a table on the same MySQL server (e.g., add a column, add an index, change a charset). - Use
spirit movewhen you need to copy tables from one MySQL server to another (e.g., migrating to a new cluster, resharding). - Use
spirit lintto validate a MySQL schema against built-in lint rules. - Use
spirit diffto compare two MySQL schemas and lint the differences. - Use
spirit fmtto canonicalizeCREATE TABLE.sqlfiles so they match MySQL's internal representation (e.g.,BOOLEAN→TINYINT(1)).
Both migrate and move share the same core engine: they stream binlog changes, copy rows in parallel, verify data with a checksum, and perform an atomic cutover. The move subcommand always uses the buffered copy algorithm, while migrate defaults to unbuffered INSERT .. SELECT (with --buffered available as an option).
cd cmd/spirit && go build- MySQL 8.0+
binlog_format=ROWlog_bin=ONlog_slave_updates=ON
See the individual usage docs linked above for the full list of configuration options.