Skip to content

Commit bfabec1

Browse files
committed
review feedback and improvements
1 parent bc7fe84 commit bfabec1

File tree

7 files changed

+105
-183
lines changed

7 files changed

+105
-183
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{{site.data.alerts.callout_info}}
2-
For CockroachDB-to-CockroachDB migrations, use [backup and restore]({% link {{ site.current_cloud_version }}/backup.md %}) with MOLT Replicator. Contact your account team for guidance.
2+
For CockroachDB-to-CockroachDB migrations, contact your account team for guidance.
33
{{site.data.alerts.end}}

src/current/_includes/molt/molt-docker.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,28 @@ When testing locally, specify the host as follows:
6767

6868
- For macOS, use `host.docker.internal`. For example:
6969

70+
{% if page.name == "molt-replicator.md" %}
71+
~~~
72+
--sourceConn 'postgres://postgres:[email protected]:5432/molt?sslmode=disable'
73+
--targetConn "postgres://[email protected]:26257/molt?sslmode=disable"
74+
~~~
75+
{% else %}
7076
~~~
7177
--source 'postgres://postgres:[email protected]:5432/molt?sslmode=disable'
7278
--target "postgres://[email protected]:26257/molt?sslmode=disable"
7379
~~~
80+
{% endif %}
7481
7582
- For Linux and Windows, use `172.17.0.1`. For example:
7683
84+
{% if page.name == "molt-replicator.md" %}
85+
~~~
86+
--sourceConn 'postgres://postgres:[email protected]:5432/molt?sslmode=disable'
87+
--targetConn "postgres://[email protected]:26257/molt?sslmode=disable"
88+
~~~
89+
{% else %}
7790
~~~
7891
--source 'postgres://postgres:[email protected]:5432/molt?sslmode=disable'
7992
--target "postgres://[email protected]:26257/molt?sslmode=disable"
80-
~~~
93+
~~~
94+
{% endif %}

src/current/_includes/molt/molt-troubleshooting.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## Troubleshooting
22

3+
{% if page.name != "migrate-resume-replication.md" %}
34
### Fetch issues
45

56
##### Fetch exits early due to mismatches
@@ -41,7 +42,7 @@ GRANT SELECT, FLASHBACK ON migration_schema.orders TO C##MIGRATION_USER;
4142

4243
##### Table or view does not exist
4344

44-
If the Oracle migration user lacks privileges on certain tables, you may receive errors stating that the table or view does not exist. Either use `--table-filter` to [limit the tables to be migrated](#schema-and-table-filtering), or grant the migration user `SELECT` privileges on all objects in the schema. Refer to [Create migration user on source database](#create-migration-user-on-source-database).
45+
If the Oracle migration user lacks privileges on certain tables, you may receive errors stating that the table or view does not exist. Either use `--table-filter` to {% if page.name == "migrate-resume-replication.md" %}[limit the tables to be migrated]({% link molt/migrate-load-replicate.md %}#schema-and-table-filtering){% else %}[limit the tables to be migrated](#schema-and-table-filtering){% endif %}, or grant the migration user `SELECT` privileges on all objects in the schema. Refer to {% if page.name == "migrate-resume-replication.md" %}[Create migration user on source database]({% link molt/migrate-load-replicate.md %}#create-migration-user-on-source-database){% else %}[Create migration user on source database](#create-migration-user-on-source-database){% endif %}.
4546

4647
{% if page.name != "migrate-bulk-load.md" %}
4748
##### Missing redo logs or unavailable SCN
@@ -80,6 +81,7 @@ If you shut down `molt` or `replicator` unexpectedly (e.g., with `kill -9` or a
8081

8182
Replace `sid` and `serial#` in the preceding statement with the values returned by the `SELECT` query.
8283
</section>
84+
{% endif %}
8385

8486
{% if page.name != "migrate-bulk-load.md" %}
8587
### Replicator issues
@@ -128,7 +130,7 @@ Dropping a replication slot can be destructive and delete data that is not yet r
128130
run CREATE PUBLICATION molt_fetch FOR ALL TABLES;
129131
~~~
130132

131-
**Resolution:** [Create the publication](#configure-source-database-for-replication) on the source database. Ensure you also create the replication slot:
133+
**Resolution:** {% if page.name == "migrate-resume-replication.md" %}[Create the publication]({% link molt/migrate-load-replicate.md %}#configure-source-database-for-replication){% else %}[Create the publication](#configure-source-database-for-replication){% endif %} on the source database. Ensure you also create the replication slot:
132134

133135
{% include_cached copy-clipboard.html %}
134136
~~~ sql
@@ -150,7 +152,7 @@ could not connect to source database: failed to connect to `user=migration_user
150152
run SELECT pg_create_logical_replication_slot('molt_slot', 'pgoutput'); in source database
151153
~~~
152154

153-
**Resolution:** [Create the replication slot](#configure-source-database-for-replication) or verify the correct slot name:
155+
**Resolution:** {% if page.name == "migrate-resume-replication.md" %}[Create the replication slot]({% link molt/migrate-load-replicate.md %}#configure-source-database-for-replication){% else %}[Create the replication slot](#configure-source-database-for-replication){% endif %} or verify the correct slot name:
154156

155157
{% include_cached copy-clipboard.html %}
156158
~~~ sql

src/current/_includes/molt/replicator-flags-usage.md

Lines changed: 29 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,40 @@ The following [MOLT Replicator]({% link molt/molt-replicator.md %}) flags are **
22

33
{% if page.name == "migrate-load-replicate.md" %}
44
<section class="filter-content" markdown="1" data-scope="postgres">
5-
| Flag | Description |
6-
|------------------|----------------------------------------------------------------------------------------------------------------|
7-
| `--targetSchema` | **Required.** Target schema name on CockroachDB where tables will be replicated. |
8-
| `--metricsAddr` | Enable Prometheus metrics at a specified `{host}:{port}`. Metrics are served at `http://{host}:{port}/_/varz`. |
5+
| Flag | Description |
6+
|-------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
7+
| `--slotName` | **Required.** PostgreSQL replication slot name. Must match the slot name specified with `--pglogical-replication-slot-name` in the [MOLT Fetch command](#start-fetch). |
8+
| `--targetSchema` | **Required.** Target schema name on CockroachDB where tables will be replicated. |
9+
| `--stagingSchema` | **Required.** Staging schema name for replication metadata and checkpoints. |
10+
| `--stagingCreateSchema` | Automatically create the staging schema if it does not exist. Include this flag when starting replication for the first time. |
11+
| `--metricsAddr` | Enable Prometheus metrics at a specified `{host}:{port}`. Metrics are served at `http://{host}:{port}/_/varz`. |
912
</section>
1013

1114
<section class="filter-content" markdown="1" data-scope="mysql">
12-
| Flag | Description |
13-
|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
14-
| `--targetSchema` | **Required.** Target schema name on CockroachDB where tables will be replicated. |
15-
| `--defaultGTIDSet` | **Required.** Default GTID set for changefeed. |
16-
| `--fetchMetadata` | Explicitly fetch column metadata for MySQL versions that do not support `binlog_row_metadata`. Requires `SELECT` permissions on the source database or `PROCESS` privileges. |
17-
| `--metricsAddr` | Enable Prometheus metrics at a specified `{host}:{port}`. Metrics are served at `http://{host}:{port}/_/varz`. |
18-
| `--userscript` | Path to a userscript that enables table filtering from MySQL sources. Refer to [Table filter userscript](#table-filter-userscript). |
15+
| Flag | Description |
16+
|-------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
17+
| `--targetSchema` | **Required.** Target schema name on CockroachDB where tables will be replicated. |
18+
| `--defaultGTIDSet` | **Required.** Default GTID set for changefeed. |
19+
| `--stagingSchema` | **Required.** Staging schema name for replication metadata and checkpoints. |
20+
| `--stagingCreateSchema` | Automatically create the staging schema if it does not exist. Include this flag when starting replication for the first time. |
21+
| `--fetchMetadata` | Explicitly fetch column metadata for MySQL versions that do not support `binlog_row_metadata`. Requires `SELECT` permissions on the source database or `PROCESS` privileges. |
22+
| `--metricsAddr` | Enable Prometheus metrics at a specified `{host}:{port}`. Metrics are served at `http://{host}:{port}/_/varz`. |
23+
| `--userscript` | Path to a userscript that enables table filtering from MySQL sources. Refer to [Table filter userscript](#table-filter-userscript). |
1924

2025
Replication from MySQL requires `--defaultGTIDSet`, which sets the starting GTID for replication. You can find this value in the `cdc_cursor` field of the `fetch complete` message after the [initial data load](#start-fetch) completes.
2126
</section>
2227

2328
<section class="filter-content" markdown="1" data-scope="oracle">
24-
| Flag | Description |
25-
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------|
26-
| `--targetSchema` | **Required.** Target schema name on CockroachDB where tables will be replicated. |
27-
| `--sourceSchema` | **Required.** Source schema name on Oracle where tables will be replicated from. |
28-
| `--scn` | **Required.** Snapshot System Change Number (SCN) for the initial changefeed starting point. |
29-
| `--backfillFromSCN` | **Required.** SCN of the earliest active transaction at the time of the snapshot. Ensures no transactions are skipped. |
30-
| `--metricsAddr` | Enable Prometheus metrics at a specified `{host}:{port}`. Metrics are served at `http://{host}:{port}/_/varz`. |
31-
| `--userscript` | Path to a userscript that enables table filtering from Oracle sources. Refer to [Table filter userscript](#table-filter-userscript). |
29+
| Flag | Description |
30+
|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------|
31+
| `--sourceSchema` | **Required.** Source schema name on Oracle where tables will be replicated from. |
32+
| `--targetSchema` | **Required.** Target schema name on CockroachDB where tables will be replicated. |
33+
| `--scn` | **Required.** Snapshot System Change Number (SCN) for the initial changefeed starting point. |
34+
| `--backfillFromSCN` | **Required.** SCN of the earliest active transaction at the time of the snapshot. Ensures no transactions are skipped. |
35+
| `--stagingSchema` | **Required.** Staging schema name for replication metadata and checkpoints. |
36+
| `--stagingCreateSchema` | Automatically create the staging schema if it does not exist. Include this flag when starting replication for the first time. |
37+
| `--metricsAddr` | Enable Prometheus metrics at a specified `{host}:{port}`. Metrics are served at `http://{host}:{port}/_/varz`. |
38+
| `--userscript` | Path to a userscript that enables table filtering from Oracle sources. Refer to [Table filter userscript](#table-filter-userscript). |
3239

3340
Replication from Oracle requires `--sourceSchema`, `--scn`, and `--backfillFromSCN`. The `--sourceSchema` specifies the Oracle schema to replicate from, while `--scn` and `--backfillFromSCN` specify the snapshot SCN and the earliest active transaction SCN, respectively. You can find the SCN values in the message `replication-only mode should include the following replicator flags` after the [initial data load](#start-fetch) completes.
3441
</section>
@@ -39,38 +46,11 @@ Replication from Oracle requires `--sourceSchema`, `--scn`, and `--backfillFromS
3946
| `--stagingSchema` | **Required.** Staging schema name for the changefeed checkpoint table. |
4047
| `--metricsAddr` | Enable Prometheus metrics at a specified `{host}:{port}`. Metrics are served at `http://{host}:{port}/_/varz`. |
4148

42-
Resuming replication requires `--stagingSchema`, which specifies the staging schema name used as a checkpoint. MOLT Fetch [logs the staging schema name]({% link molt/migrate-load-replicate.md %}#start-replicator) as the `staging database name` when it starts replication. For example:
49+
Resuming replication requires `--stagingSchema`, which specifies the staging schema name used as a checkpoint. The staging schema was created during [initial replication setup]({% link molt/migrate-load-replicate.md %}#start-replicator) with `--stagingCreateSchema`.
4350

44-
~~~ json
45-
{"level":"info","time":"2025-02-10T14:28:13-05:00","message":"staging database name: _replicator_1749699789613149000"}
46-
~~~
47-
48-
<section class="filter-content" markdown="1" data-scope="mysql">
49-
{{site.data.alerts.callout_info}}
50-
When using `--table-filter`, you must also include `--userscript`. Refer to [Table filter userscript]({% link molt/migrate-load-replicate.md %}?filters=mysql#table-filter-userscript).
51-
{{site.data.alerts.end}}
52-
</section>
53-
54-
<section class="filter-content" markdown="1" data-scope="oracle">
55-
{{site.data.alerts.callout_info}}
56-
When using `--table-filter`, you must also include `--userscript`. Refer to [Table filter userscript]({% link molt/migrate-load-replicate.md %}?filters=oracle#table-filter-userscript).
57-
{{site.data.alerts.end}}
58-
</section>
59-
60-
{% elsif page.name == "migrate-data-load-and-replication.md" %}
61-
| Flag | Description |
62-
|-----------------|----------------------------------------------------------------------------------------------------------------|
63-
| `--metricsAddr` | Enable Prometheus metrics at a specified `{host}:{port}`. Metrics are served at `http://{host}:{port}/_/varz`. |
64-
65-
<section class="filter-content" markdown="1" data-scope="mysql">
66-
{{site.data.alerts.callout_info}}
67-
When using `--table-filter`, you must also include `--userscript`. Refer to [Table filter userscript](#table-filter-userscript).
68-
{{site.data.alerts.end}}
69-
</section>
70-
71-
<section class="filter-content" markdown="1" data-scope="oracle">
51+
<section class="filter-content" markdown="1" data-scope="mysql oracle">
7252
{{site.data.alerts.callout_info}}
73-
When using `--table-filter`, you must also include `--userscript`. Refer to [Table filter userscript](#table-filter-userscript).
53+
When using `--table-filter`, you must also include `--userscript`. Refer to [Table filter userscript]({% link molt/migrate-load-replicate.md %}#table-filter-userscript).
7454
{{site.data.alerts.end}}
7555
</section>
7656

src/current/molt/migrate-load-replicate.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,46 @@ Use [MOLT Verify]({% link molt/molt-verify.md %}) to confirm that the source and
7373

7474
## Configure Replicator
7575

76+
### Replication connection strings
77+
78+
MOLT Replicator uses `--sourceConn` and `--targetConn` to specify the source and target database connections.
79+
80+
`--sourceConn` specifies the connection string of the source database:
81+
82+
<section class="filter-content" markdown="1" data-scope="postgres">
83+
~~~
84+
--sourceConn 'postgresql://{username}:{password}@{host}:{port}/{database}'
85+
~~~
86+
</section>
87+
88+
<section class="filter-content" markdown="1" data-scope="mysql">
89+
~~~
90+
--sourceConn 'mysql://{username}:{password}@{protocol}({host}:{port})/{database}'
91+
~~~
92+
</section>
93+
94+
<section class="filter-content" markdown="1" data-scope="oracle">
95+
~~~
96+
--sourceConn 'oracle://{username}:{password}@{host}:{port}/{service_name}'
97+
~~~
98+
99+
For Oracle Multitenant databases, also specify `--sourcePDBConn` with the PDB connection string:
100+
101+
~~~
102+
--sourcePDBConn 'oracle://{username}:{password}@{host}:{port}/{pdb_service_name}'
103+
~~~
104+
</section>
105+
106+
`--targetConn` specifies the target CockroachDB connection string:
107+
108+
~~~
109+
--targetConn 'postgresql://{username}:{password}@{host}:{port}/{database}'
110+
~~~
111+
112+
{{site.data.alerts.callout_success}}
113+
Follow best practices for securing connection strings. Refer to [Secure connections](#secure-connections).
114+
{{site.data.alerts.end}}
115+
76116
### Replication flags
77117

78118
{% include molt/replicator-flags-usage.md %}

0 commit comments

Comments
 (0)