Migrate MongoDB to SQL Server — Collections into Tables

One-click data migration tool for MongoDB to SQL Server. GUI & CLI supported, cross-platform, 100% local & secure.

All MongoDB Deployments Windows / Linux / macOS GUI + CLI Modes 4 Mapping Modes Scheduled Sync

What you can do with MongoToDB

A MongoDB database has no schema, so the work is deciding what each collection becomes: one table, many tables, or one table fed by many collections. Eight operations, one dialog.

What arrives in SQL Server is a table, not a linked server: no ongoing connection to MongoDB is created, so the target is queryable by anything that speaks T-SQL. Re-run the session when the source changes, or schedule it — the same mapping is reused.

Whole database

Migrate a whole database

Every collection becomes a table in one run.

  • Database and collection names map to schema and table names
  • Start here when the SQL Server schema does not exist yet
View screenshot
One collection

Collection to table

One collection in, one SQL Server table out.

  • Nested documents and arrays land in a nvarchar(max) column
  • The target table is created from the sampled shape
View screenshot
One collection

Query to table

Filter on the MongoDB side, then insert.

  • Any find() filter — or an aggregation — defines the rows
  • Only the returned documents are written
View screenshot
Many collections

Merge collections to one table

Collections that share a shape add up to one table.

  • One collection per day or per tenant is the usual case
  • Columns are taken from the first document, the rest are nullable
View screenshot
Many collections

Batch collections to tables

Many collections, one pass.

  • Map each collection to its own table
  • Replace or append is chosen per collection
View screenshot
Both sides

Map BSON types to SQL Server

Field by field, decided once.

  • ObjectId → text, Date → timestamptz
  • Nested documents and arrays → jsonb; Decimal128 → numeric
View screenshot
Both sides

Keep SQL Server current

Re-run the session instead of re-importing.

  • Full sync replaces the contents
  • Incremental sync upserts on the key you name (_id is the usual one)
View screenshot
Automation

Schedule the job

Run it on a timer.

  • Save the session as .bat or .sh
  • Task Scheduler on Windows, Crontab on Linux, launchd on macOS
View screenshot

How to Migrate MongoDB to SQL Server in 4 Simple Steps

  1. Connect MongoDB and SQL Server: Enter MongoDB URI or config, test connection in one click 📷. Input SQL Server host, port, account and target database 📷.
  2. Select Migration Mode: Choose query, single collection or multiple collections. 📷
  3. Configure Field Mapping & Preview: Auto-load fields, customize types and rules 📷. Check sample data before real migration 📷.
  4. Start & Verify: Monitor progress 📷 and view result directly 📷.

MongoDB — SQL Server Type Mapping

MongoDB (BSON)SQL Server
Stringnvarchar(450) / nvarchar(max)
ObjectIdnvarchar(36) or uniqueidentifier
Int32 / Int64int / bigint
Doublefloat
Decimal128decimal(38,10)
Booleanbit
Datedatetime2(7)
Nested documentnvarchar(max) holding JSON
Arraynvarchar(max) holding JSON
BinDatavarbinary(max)

Common Pitfalls When Moving MongoDB into SQL Server

  • No schema means the table is guessed: the tool samples documents, so a field that appears later becomes a column only on the next run.
  • ObjectId has no T-SQL type of its own: nvarchar(36) and uniqueidentifier sort differently, so pick the one the target application will query.
  • Mixed types in one field arrive as nvarchar(max) — MongoDB allows a string and a number in the same field, T-SQL does not.
  • A single nvarchar(max) or varbinary(max) value is capped at 2 GB, so an oversized document fails at the target, not at the source.
  • Indexes, validators and _id uniqueness are not carried over as constraints: the rows arrive, the rules do not.

CLI Mode for Automation & Scheduled Sync

Prerequisite

Save your migration session in GUI first (config auto-generated).

Run via Command Line
  • Windows: Launch executable with saved session file
  • Linux / macOS: Run script in terminal with session path
Schedule Auto Sync
  • Windows: Use Task Scheduler with .bat file
  • Linux/macOS: Use Crontab with .sh script

Frequently Asked Questions

Which MongoDB versions are supported?

Supports MongoDB 4.2 ~ 8.0+.

Which SQL Server versions are supported?

Supports SQL Server 2008 R2 through 2022, plus Azure SQL Database.

What’s the limit of free trial?

Free trial supports up to 1000 rows. All features are fully unlocked.

How to fix connection failure to MongoDB Atlas?

Check network, port, URI, account and whitelist settings.

Can I sync data automatically?

Yes. Use CLI + scheduled tasks to achieve real-time sync.

How to handle incompatible data types?

Auto-adapt most types. ObjectId can be mapped to VARCHAR manually.

Start Your MongoDB to SQL Server Migration Today

Fast, secure, easy-to-use, cross-platform. No technical skills required.

Free Download Now