This guide shows you how to use gh-ost to migrate your MySQL databases in Bytebase.
INSERT
, DELETE
, UPDATE
applied to your table) to the ghost table.waiting for approval
(if custom approval flow is configured) or waiting for rollout
. Follow the order to roll out the task.
The Sync data task reads rows on the original table and writes them to the ghost table, meanwhile propagating changes in the original table to the ghost table so that the ghost table can catch up with the original table.
Behind the scenes, gh-ost will create two tables:
~yourtablename_{timestamp}_ghc
~yourtablename_{timestamp}_gho
~yourtablename_{timestamp}_gho
and ~yourtablename_{timestamp}_ghc
, then retry.
yourtablename
, ~yourtablename_{timestamp}_gho
to ~yourtablename_{timestamp}_del
, yourtablename
respectively to switch the original table and the ghost table.
After the Sync data task completes, the Switch tables task is waiting for approval
(if custom approval flow is configured) or waiting for rollout
. Follow the order to roll out the task.
~yourtablename_{timestamp}_del
after migration~yourtablename_{timestamp}_del
. Make sure there is no data loss, then manually drop the original table if you wish. You can check the table by clicking Show Bytebase reserved tables on the database page.
/tmp/gh-ost.{taskID}.{databaseID}.{databaseName}.{tableName}.sock
To find the UNIX socket file, you must acquire the database and task id.
/tmp/gh-ost.112.107.employeenofk.employee.sock
taskID
, databaseID
, databaseName
and tableName
accordingly.taskID
, databaseID
, databaseName
and tableName
accordingly./tmp/gh-ost.taskID.databaseID.databaseName.tableName.sock
/tmp/gh-ost.taskID.databaseID.databaseName.tableName.postponeFlag
~yourtablename_{timestamp}_gho
~yourtablename_{timestamp}_ghc