DBToMongo » Use cases » Combine split tables
Download DBToMongo Free Trial » Buy DBToMongo Now »
The relational database grew one year at a time, or one region at a time: orders_2019, orders_2020, orders_eu, orders_us - the same columns, over and over, because that was practical at the time. In MongoDB the reason for the split disappears. What you want is one orders collection.
Copying them one by one and merging afterwards means loading the same collection a dozen times, and a document has no memory of which table it came from.

If the documents need to say where they came from, add that as a field on the destination and map the source table name into it - a small step that saves a lot of guessing later. Sources of different engines can be combined too: a MySQL branch and a SQL Server branch can land in the same collection.
orders_2019 and orders_2020, both documents end up in the collection. Cleaning that up is a separate job.The mode itself: similar tables to one collection. A whole database instead: migrate a database. One to one: table to collection. Adding more later without duplicates: keeping it in sync.