Skip to content

Commit

Permalink
mode documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Manan007224 committed Jun 15, 2021
1 parent 5a65912 commit 4ea968d
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions docs/source/copydbforeignkey.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,28 @@ Prerequisites

Before migrating tables with foreign key constraints via copydb there are a couple of things to take care of

- Ghostferry needs to be ran with `SkipForeignKeyConstraintsCheck = true`, which will disable ghostferry to check foreign key
- Ghostferry needs to be ran with ``SkipForeignKeyConstraintsCheck = true``, which will disable ghostferry to check foreign key
constraints during initialization.

- Source DB should be read_only.
- Source DB should be ``read_only``.

- Need to disable foreign key constraint checks on target DB by passing the following config to target db

.. code-block:: json
"Params": {
"foreign_key_checks": "0"
}
- Even though foreign key constraint checks are disabled on target db, table and db creation must happen in a specific order (eg parent should be created
before child table). This creation order can be specified by passing ``TablesToBeCreatedFirst`` in the config, or else the table creation order will be
figured out by copydb.

Limitations
-------------

- While migrating tables with foreign key constraints the source db should be read_only as there are some fundamental issues when migrating tables with foreign key constraints at the same time when writes are occurring to the source database. This issue descibes briefly why the source database should be read_only during the migration - https://github.com/Shopify/katesql-migration-backend/issues/194.

- `Interrupt-Resume functionality` can be used as long as source database is read_only also during the interrupt period
- ``Interrupt-Resume`` functionality can be used as long as source database is read_only also during the interrupt period

- `Inline Verifier` can be used as long as it is ensured that the source database is read_only (even during the interrupt period)
- ``Inline Verifier`` can be used as long as it is ensured that the source database is read_only (even during the interrupt period)

0 comments on commit 4ea968d

Please sign in to comment.