You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -22,133 +22,114 @@ To resume replication after an interruption, refer to [Resume replication after
22
22
If you want to start replication without first running [MOLT Fetch]({% link molt/molt-fetch.md %}), you need to manually obtain a replication checkpoint from the source database and then start MOLT Replicator with the appropriate checkpoint flags.
Run the `replicator pglogical` command, specifying the slot name with `--slotName`. The replication slot automatically tracks the LSN checkpoint, so you don't need to specify an LSN value. Use `--stagingSchema` to specify a unique name for the staging database, and include `--stagingCreateSchema` to have MOLT Replicator automatically create the staging database:
50
-
51
-
{% include_cached copy-clipboard.html %}
52
-
~~~shell
53
-
replicator pglogical \
54
-
--sourceConn $SOURCE \
55
-
--targetConn $TARGET \
56
-
--targetSchema defaultdb.public \
57
-
--slotName molt_slot \
58
-
--stagingSchema _replicator \
59
-
--stagingCreateSchema \
60
-
--metricsAddr :30005 \
61
-
--verbose
62
-
~~~
25
+
1. Create a publication for the tables you want to replicate:
26
+
27
+
{% include_cached copy-clipboard.html %}
28
+
~~~ sql
29
+
CREATE PUBLICATION molt_publication FOR TABLE employees, payments, orders;
30
+
~~~
31
+
32
+
1. Create a replication slot to track the LSN checkpoint:
1. Run the `replicator pglogical` command, specifying the slot name with `--slotName`. The replication slot automatically tracks the LSN checkpoint, so you don't need to specify an LSN value. Use `--stagingSchema` to specify a unique name for the staging database, and include `--stagingCreateSchema` to have MOLT Replicator automatically create the staging database:
Run the `replicator mylogical` command, specifying the GTID from the `Executed_Gtid_Set` value with `--defaultGTIDSet`. Use `--stagingSchema` to specify a unique name for the staging database, and include `--stagingCreateSchema` to have MOLT Replicator automatically create the staging database:
For MySQL versions that do not support `binlog_row_metadata`, include `--fetchMetadata` to explicitly fetch column metadata. This requires additional permissions on the source MySQL database. Grant `SELECT` permissions with `GRANT SELECT ON source_database.* TO 'migration_user'@'localhost';`. If that is insufficient for your deployment, use `GRANT PROCESS ON *.* TO 'migration_user'@'localhost';`, though this is more permissive and allows seeing processes and server status.
106
-
{{site.data.alerts.end}}
107
-
</section>
62
+
1. Get the current GTID set to use as the starting point for replication:
1. Run the `replicator mylogical` command, specifying the GTID from the `Executed_Gtid_Set` value with `--defaultGTIDSet`. Use `--stagingSchema` to specify a unique name for the staging database, and include `--stagingCreateSchema` to have MOLT Replicator automatically create the staging database:
-- Query the starting SCN of the earliest active transaction
120
-
SELECTMIN(t.START_SCNB) FROM V$TRANSACTION t;
121
-
~~~
96
+
{{site.data.alerts.callout_success}}
97
+
For MySQL versions that do not support `binlog_row_metadata`, include `--fetchMetadata` to explicitly fetch column metadata. This requires additional permissions on the source MySQL database. Grant `SELECT` permissions with `GRANT SELECT ON source_database.* TO 'migration_user'@'localhost';`. If that is insufficient for your deployment, use `GRANT PROCESS ON *.* TO 'migration_user'@'localhost';`, though this is more permissive and allows seeing processes and server status.
1. Get the current SCN to use as the starting point for replication:
124
103
125
-
-`--scn`: Use the result from the first query (current SCN)
126
-
-`--backfillFromSCN`: Use the result from the second query (earliest active transaction SCN). If the second query returns no results, use the result from the first query instead.
104
+
{% include_cached copy-clipboard.html %}
105
+
~~~ sql
106
+
SELECT CURRENT_SCN FROM V$DATABASE;
107
+
~~~
127
108
128
-
### Start Replicator
109
+
Use this SCN value for both `--backfillFromSCN` and `--scn` flags.
129
110
130
-
Run the `replicator oraclelogminer` command, specifying the SCN values from the checkpoint queries. Use `--stagingSchema` to specify a unique name for the staging database, and include `--stagingCreateSchema` to have MOLT Replicator automatically create the staging database:
111
+
1.Run the `replicator oraclelogminer` command, specifying the SCN values from the checkpoint queries. Use `--stagingSchema` to specify a unique name for the staging database, and include `--stagingCreateSchema` to have MOLT Replicator automatically create the staging database:
131
112
132
-
{% include_cached copy-clipboard.html %}
133
-
~~~shell
134
-
replicator oraclelogminer \
135
-
--sourceConn $SOURCE \
136
-
--sourcePDBConn $SOURCE_PDB \
137
-
--targetConn $TARGET \
138
-
--sourceSchema migration_schema \
139
-
--targetSchema defaultdb.public \
140
-
--backfillFromSCN 26685444 \
141
-
--scn 26685786 \
142
-
--stagingSchema _replicator \
143
-
--stagingCreateSchema \
144
-
--metricsAddr :30005 \
145
-
--userscript table_filter.ts \
146
-
--verbose
147
-
~~~
113
+
{% include_cached copy-clipboard.html %}
114
+
~~~ shell
115
+
replicator oraclelogminer \
116
+
--sourceConn $SOURCE \
117
+
--sourcePDBConn $SOURCE_PDB \
118
+
--targetConn $TARGET \
119
+
--sourceSchema migration_schema \
120
+
--targetSchema defaultdb.public \
121
+
--backfillFromSCN 26685444 \
122
+
--scn 26685786 \
123
+
--stagingSchema _replicator \
124
+
--stagingCreateSchema \
125
+
--metricsAddr :30005 \
126
+
--userscript table_filter.ts \
127
+
--verbose
128
+
~~~
148
129
149
-
{{site.data.alerts.callout_info}}
150
-
When filtering out tables in a schema with a userscript, replication performance may decrease because filtered tables are still included in LogMiner queries and processed before being discarded.
151
-
{{site.data.alerts.end}}
130
+
{{site.data.alerts.callout_info}}
131
+
When filtering out tables in a schema with a userscript, replication performance may decrease because filtered tables are still included in LogMiner queries and processed before being discarded.
Copy file name to clipboardExpand all lines: src/current/molt/molt-replicator.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,9 +57,13 @@ Oracle source (`oraclelogminer`): MOLT Replicator uses Oracle LogMiner to captur
57
57
58
58
MOLT Replicator offers three consistency modes for balancing throughput and transactional guarantees:
59
59
60
-
1. Consistent (default for CockroachDB sources): Preserves per-row order and source transaction atomicity. Concurrent transactions are controlled by `--parallelism`.
60
+
1. Consistent (default for CockroachDB sources, failback mode only): Preserves per-row order and source transaction atomicity. Concurrent transactions are controlled by `--parallelism`.
61
61
62
-
1. BestEffort: Relaxes atomicity across tables that do not have foreign key constraints between them (maintains coherence within FK-connected groups). Enable with `--bestEffortOnly` or allow auto-entry via `--bestEffortWindow` set to a positive duration (e.g., `1s`).
62
+
1. BestEffort (failback mode only): Relaxes atomicity across tables that do not have foreign key constraints between them (maintains coherence within FK-connected groups). Enable with `--bestEffortOnly` or allow auto-entry via `--bestEffortWindow` set to a positive duration (e.g., `1s`).
63
+
64
+
{{site.data.alerts.callout_info}}
65
+
For independent tables (with no foreign key constraints), BestEffort mode applies changes immediately as they arrive, without waiting for the resolved timestamp. This provides higher throughput for tables that have no relationships with other tables.
66
+
{{site.data.alerts.end}}
63
67
64
68
1. Immediate (default for PostgreSQL, MySQL, and Oracle sources): Applies updates as they arrive to Replicator with no buffering or waiting for resolved timestamps. Provides highest throughput but requires no foreign keys on the target schema.
0 commit comments