# Making CTK's MongoDB CDC relay work

**URL:** <https://community.cratedb.com/t/making-ctks-mongodb-cdc-relay-work/2072>\
**Category:** Configuration\
**Tags:** integration, mongodb\
**Created:** [August 18, 2025, 2:35am UTC](https://community.cratedb.com/t/making-ctks-mongodb-cdc-relay-work/2072 "2025-08-18T02:35:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![M\_Duyen\_L\_u](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/m_duyen_l_u/32/1410_2.png) [@M\_Duyen\_L\_u](https://community.cratedb.com/u/M_Duyen_L_u)\
**Post date:** [August 18, 2025, 2:35am UTC](https://community.cratedb.com/t/making-ctks-mongodb-cdc-relay-work/2072/1 "2025-08-18T02:35:33Z")

</div>

Hi amotl again,

Hope you have a great week , I tried to use MongoDB Relay but it’s not working

```auto
export MONGODB_URL="mongodb://user:pass@host:port/collection/table?replicaSet=rs0&readPreference=secondary"
export MONGODB_URL_CTK="mongodb+cdc://user:pass@host:port/collection/table?replicaSet=rs0&readPreference=secondary"
export CRATEDB_CLUSTER_URL="crate://user:pass@host/collection/table?ssl=true"

ctk load table "${MONGODB_URL_CTK}" --cluster-url="${CRATEDB_CLUSTER_URL}"
NotImplementedError: Importing resource not implemented yet: mongodb+cdc://user:pass@host:port/collection/table?replicaSet=rs0&readPreference=secondary

ctk load table "${MONGODB_URL_CTK}"
NotImplementedError: Importing resource not implemented yet: mongodb+cdc://user:pass@host:port/collection/table?replicaSet=rs0&readPreference=secondary

```

---

<div class="post-metadata">

**Author:** ![M\_Duyen\_L\_u](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/m_duyen_l_u/32/1410_2.png) [@M\_Duyen\_L\_u](https://community.cratedb.com/u/M_Duyen_L_u)\
**Post date:** [August 18, 2025, 12:48pm UTC](https://community.cratedb.com/t/making-ctks-mongodb-cdc-relay-work/2072/2 "2025-08-18T12:48:02Z")

</div>

I’m hosted both MongoDB and CrateDB on-premise ☹

---

<div class="post-metadata">

**Author:** ![amotl](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/amotl/32/617_2.png) [@amotl](https://community.cratedb.com/u/amotl)\
**Post date:** [August 19, 2025, 12:36pm UTC](https://community.cratedb.com/t/making-ctks-mongodb-cdc-relay-work/2072/3 "2025-08-19T12:36:19Z")

</div>

Hi again,

> [@M\_Duyen\_L\_u](#):
>
> `NotImplementedError: Importing resource not implemented yet: mongodb+cdc://`

This got fixed with [v0.0.40](https://github.com/crate/cratedb-toolkit/releases/tag/v0.0.40), thanks a stack for the report!

With kind regards,  
Andreas.

---

<div class="post-metadata">

**Author:** ![M\_Duyen\_L\_u](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/m_duyen_l_u/32/1410_2.png) [@M\_Duyen\_L\_u](https://community.cratedb.com/u/M_Duyen_L_u)\
**Post date:** [August 21, 2025, 7:37am UTC](https://community.cratedb.com/t/making-ctks-mongodb-cdc-relay-work/2072/4 "2025-08-21T07:37:57Z")

</div>

Hi amotl again ,

I tried update v0.0.41 and v0.0.40 and used again to use CDC Relay but it’s not work . I used ctk load table without CDC to copy data and it’s successfully . Please help me fix CDC error . Thanks you very much

```auto
$ ctk load table "mongodb://user:pass@host/collection/table" \
--cluster-url="crate://user:pass@host/db/table?ssl=true"
2025-08-21 07:20:27,031 [cratedb_toolkit.io.mongodb.api] INFO : mongodb_copy. source=mongodb://user:pass@host/collection/table, target=crate://user:pass@host/db/table?ssl=true
2025-08-21 07:20:27,406 [cratedb_toolkit.io.mongodb.copy] INFO : Starting MongoDBFullLoad. source=mongodb://user:pass@host/collection/table, target=crate://user:pass@host/db/table?ssl=true
2025-08-21 07:20:27,649 [cratedb_toolkit.io.mongodb.copy] INFO : Source: MongoDB DatabaseAddress(uri=URL('mongodb://user:pass@host/collection/table')) count=2
2025-08-21 07:20:28,006 [cratedb_toolkit.io.mongodb.copy] INFO : Target: CrateDB table=collection.table count=2
WRITE: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 11.21it/s]
2025-08-21 07:20:28,191 [cratedb_toolkit.io.mongodb.copy] INFO : Bulk processor metrics: BulkMetrics(count_success_total=2, count_error_total=0, bytes_write_total=3080, bytes_error_total=0, rate_current=0, rate_max=0)
2025-08-21 07:20:28,192 [cratedb_toolkit.io.mongodb.copy] INFO : Number of records written: success=2, error=0
$ ctk load table "${MONGODB_URL_CTK}"
2025-08-21 07:20:38,152 [cratedb_toolkit.io.mongodb.api] INFO : Running MongoDB CDC relay
2025-08-21 07:20:38,153 [cratedb_toolkit.io.mongodb.cdc] INFO : Initializing MongoDB CDC Relay. mongodb=mongodb://user:pass@host/collection/table, cratedb=crate://user:pass@host/db/table?ssl=true

```
