Migrate from MongoDB to SingleStoreDB
To migrate your collection from MongoDB to SingleStoreDB, you can perform the following tasks:
Export your collection using
mongoexport
, and then import the exported data into your SingleStoreDB Cloud workspace usingmongoimport
.
Export Data using mongoexport
You can export your collection in either JSON or CSV format using the mongoexport
command-line tool. Run the mongoexport
command from the system command-line. Refer to mongoexport for more information.
Run the following command to export collections from a MongoDB endpoint:
mongoexport --uri='mongodb://<user>:<password>@<MongoDB_endpoint>:27017' \ --db=<database_name> --collection=<collection_name> \ --out=<path_to_output/filename.[json|csv]>
Run the following command to export collections from a MongoDB Atlas endpoint:
mongoexport --uri mongodb+srv://<username>@<atlas_endpoint>/<database_name> \ --collection=<collection_name> --out=<path_to_output/filename.[json|csv]>
Import Data using mongoimport
To import the data exported using mongoexport
into your SingleStoreDB Cloud workspace, use the mongoimport
command-line tool. mongoimport
supports Extended JSON, CSV, and TSV formats that have been exported via mongoexport
. Run the mongoimport
command from the system command-line. Refer to mongoimport for more information.
mongoimport \ --uri 'mongodb://<user>:<password>@<SingleStore_Kai_for_MongoDB_endpoint>:27017/?authMechanism=PLAIN&tls=true&loadBalanced=true' \ --db <database_name> --collection <collection_name> \ --file <path_to_import_file/filename.[json|csv]>
If your file contains arrays, add --jsonArray
after the database name.
Replicate MongoDB Collections to SingleStoreDB
SingleStore provides a private preview solution to perform a one-time data replication or ongoing CDC (Change Data Capture) from MongoDB collections into SingleStoreDB. Contact SingleStore Support to preview this feature.