goback mysql
Back up and restore MySQL servers
goback works with MySQL 5.5 through 8.4. Dumps and the binary log go into separate sets.
goback [global flags] mysql <command>mysql receive
Section titled “mysql receive”Receive the server’s binlogs as a replica and commit them to the set named by –set until SIGTERM
receive reads host, port, socket, user, password and ssl-mode from the [client] group of –defaults-extra-file and ~/.my.cnf. The user needs REPLICATION SLAVE and REPLICATION CLIENT. receive starts at the newest dump’s binlog, so take a dump first. After RESET MASTER, the binlogs continue in a new chain in the same set.
goback [global flags] mysql receive [flags]| Flag | Description | Environment | Default |
|---|---|---|---|
--spool value |
directory that holds binlogs until they are committed | GOBACK_MYSQL_SPOOL |
|
--dump-set value |
set that holds the server’s dumps | ||
--defaults-extra-file value |
MySQL option file with the connection settings and password; read before ~/.my.cnf | GOBACK_MYSQL_DEFAULTS_EXTRA_FILE |
|
--server-id value |
server id to connect with as a replica; derived from the set’s name by default | ||
--commit-every value |
how often to commit new binlog; at least 10s | 1m0s |
|
--commit-bytes value |
commit early once this much new binlog has arrived | 256MiB |
|
--window value |
how far back point-in-time recovery reaches; binlogs older than the oldest dump in this window are retired | 336h0m0s |
|
--shutdown-grace value |
how long the last commit may take after SIGTERM | 30s |
mysql dump
Section titled “mysql dump”Dump the server with mysqldump and commit it to the set named by –set
The MySQL client programs read their connection settings from ~/.my.cnf or –defaults-extra-file. With log_bin on, the dump records the binary log position it is consistent with.
goback [global flags] mysql dump [flags]| Flag | Description | Environment | Default |
|---|---|---|---|
--binlog-set value |
set that holds the server’s binlogs; the dump joins its chain | ||
--no-binlog-position |
skip recording the binary log position, even with log_bin on; the dump then needs no global read lock and no RELOAD or REPLICATION CLIENT privilege | ||
--defaults-extra-file value |
MySQL option file with the connection settings and password; the client programs read it before their own option files; without it, they read only ~/.my.cnf | GOBACK_MYSQL_DEFAULTS_EXTRA_FILE |
|
--mysql value |
the mysql client to run | GOBACK_MYSQL |
mysql |
--mysqldump value |
the mysqldump program to run | GOBACK_MYSQLDUMP |
mysqldump |
--mysqlbinlog value |
the mysqlbinlog program that restore replays binlogs with; its version must be at least the source server’s | GOBACK_MYSQLBINLOG |
mysqlbinlog |
mysql restore
Section titled “mysql restore”Load a dump into an empty running server, then replay the binlog set if one is given
The MySQL client programs read the target’s connection settings from ~/.my.cnf or –defaults-extra-file. With –to, restore writes the dump and the binlogs into a directory instead of applying them. It then prints the commands that apply them.
goback [global flags] mysql restore [flags]| Flag | Description | Environment | Default |
|---|---|---|---|
--dump-set value |
set that holds the server’s dumps | ||
--binlog-set value |
set that holds the server’s binlogs, for restoring past the dump | ||
--at value |
moment to restore to, in RFC 3339 (2026-10-02T14:30:00Z) to the second; the end of the binlog set by default | ||
--to value |
empty directory to write the dump and the binlogs into instead of applying them | ||
--work-dir value |
directory to download the binlogs into before the replay; the system’s temporary directory by default | ||
--force |
load into a server that already holds databases | ||
--defaults-extra-file value |
MySQL option file with the connection settings and password; the client programs read it before their own option files; without it, they read only ~/.my.cnf | GOBACK_MYSQL_DEFAULTS_EXTRA_FILE |
|
--mysql value |
the mysql client to run | GOBACK_MYSQL |
mysql |
--mysqldump value |
the mysqldump program to run | GOBACK_MYSQLDUMP |
mysqldump |
--mysqlbinlog value |
the mysqlbinlog program that restore replays binlogs with; its version must be at least the source server’s | GOBACK_MYSQLBINLOG |
mysqlbinlog |