Requirements and limitations
Requirements
You will need to have one server serving Row Based Replication (RBR) format binary logs. Right now
FULLrow image is supported.MINIMALto be supported in the near future.gh-ostprefers to work with replicas. You may still have your master configured with Statement Based Replication (SBR).If you are using a replica, the table must have an identical schema between the master and replica.
gh-ostrequires an account with these privileges:ALTER, CREATE, DELETE, DROP, INDEX, INSERT, LOCK TABLES, SELECT, TRIGGER, UPDATEon the database (schema) where your migrated table is, or of course on*.*- either:
SUPER, REPLICATION SLAVEon*.*, or:REPLICATION CLIENT, REPLICATION SLAVEon*.*
The SUPER privilege is required for STOP SLAVE, START SLAVE operations. These are used on:
Switching your
binlog_formattoROW, in the case where it is notROWand you explicitly specified--switch-to-rbr- If your replication is already in RBR (
binlog_format=ROW) you can specify--assume-rbrto avoid theSTOP SLAVE/START SLAVEoperations, hence no need forSUPER.
- If your replication is already in RBR (
Running
--test-on-replica: before the cut-over phase,gh-oststops replication so that you can compare the two tables and satisfy that the migration is sound.
Limitations
Foreign keys not supported. They may be supported in the future, to some extent.
Triggers are not supported. They may be supported in the future.
MySQL 5.7 generated columns are not supported. They may be supported in the future.
MySQL 5.7
JSONcolumns are not supported. They are likely to be supported shortly.The two before & after tables must share a
PRIMARY KEYor otherUNIQUE KEY. This key will be used bygh-ostto iterate through the table rows when copying. Read more- The migration key must not include columns with NULL values. This means either:
- The columns are
NOT NULL, or - The columns are nullable but don't contain any NULL values.
- The columns are
- by default,
gh-ostwill not run if the onlyUNIQUE KEYincludes nullable columns.- You may override this via
--allow-nullable-unique-keybut make sure there are no actualNULLvalues in those columns. Existing NULL values can't guarantee data integrity on the migrated table.
- You may override this via
- The migration key must not include columns with NULL values. This means either:
It is not allowed to migrate a table where another table exists with same name and different upper/lower case.
- For example, you may not migrate
MyTableif another table calledMYtableexists in the same schema.
- For example, you may not migrate
Amazon RDS and Google Cloud SQL are currently not supported
- We began working towards removing this limitation. See tracking issue: https://github.com/github/gh-ost/issues/163
Multisource is not supported when migrating via replica. It should work (but never tested) when connecting directly to master (
--allow-on-master)Master-master setup is only supported in active-passive setup. Active-active (where table is being written to on both masters concurrently) is unsupported. It may be supported in the future.
If you have en
enumfield as part of your migration key (typically thePRIMARY KEY), migration performance will be degraded and potentially bad. Read moreMigrating a
FEDERATEDtable is unsupported and is irrelevant to the problemgh-osttackles.