How to load data from IBM Db2 to MongoDB
Learn how to use Airbyte to synchronize your IBM Db2 data into MongoDB within minutes.


Building your pipeline or Using Airbyte
Airbyte is the only open source solution empowering data teams to meet all their growing custom business demands in the new AI era.
- Inconsistent and inaccurate data
- Laborious and expensive
- Brittle and inflexible
- Reliable and accurate
- Extensible and scalable for all your needs
- Deployed and governed your way
Start syncing with Airbyte in 3 easy steps within 10 minutes



Take a virtual tour
Demo video of Airbyte Cloud
Demo video of AI Connector Builder
Setup Complexities simplified!
Simple & Easy to use Interface
Airbyte is built to get out of your way. Our clean, modern interface walks you through setup, so you can go from zero to sync in minutes—without deep technical expertise.
Guided Tour: Assisting you in building connections
Whether you’re setting up your first connection or managing complex syncs, Airbyte’s UI and documentation help you move with confidence. No guesswork. Just clarity.
Airbyte AI Assistant that will act as your sidekick in building your data pipelines in Minutes
Airbyte’s built-in assistant helps you choose sources, set destinations, and configure syncs quickly. It’s like having a data engineer on call—without the overhead.
What sets Airbyte Apart
Modern GenAI Workflows
Move Large Volumes, Fast
An Extensible Open-Source Standard
Full Control & Security
Fully Featured & Integrated
Enterprise Support with SLAs
What our users say

Raman Singh
Predictable, straightforward pricing model that simplified budgeting and significantly reduced overall spend

Chase Zieman

“Airbyte helped us accelerate our progress by years, compared to our competitors. We don’t need to worry about connectors and focus on creating value for our users instead of building infrastructure. That’s priceless. The time and energy saved allows us to disrupt and grow faster.”

Rupak Patel
"With Airbyte, we could just push a few buttons, allow API access, and bring all the data into Google BigQuery. By blending all the different marketing data sources, we can gain valuable insights."
How to Sync to Manually
Ensure that both IBM Db2 and MongoDB are installed and properly configured on your systems. Verify that you have administrative access to both databases and that necessary tools like `db2` command-line interface for Db2 and `mongo` shell for MongoDB are operational.
Examine the data schema within IBM Db2. Identify tables, data types, relationships, and constraints. This understanding is crucial as MongoDB is schema-less, which means you'll need to determine how to represent relational data in a document-based format.
Use the `db2 export` command to extract the data from Db2. You can export data in CSV format, which is simple and widely supported. For example:
```shell
db2 export to data.csv of del select from your_table_name
```
This command exports the table `your_table_name` into a `data.csv` file.
Convert the CSV file to JSON format, which MongoDB requires for data import. You can write a custom script in Python, JavaScript, or any language you're comfortable with to read the CSV file and output JSON. Ensure that the JSON data reflects the desired structure for MongoDB documents.
In MongoDB, decide on the database and collection where the data will reside. If the database or collection does not exist, you can create them using the MongoDB shell:
```shell
use your_database_name
db.createCollection("your_collection_name")
```
Use the `mongoimport` tool to import the JSON data into MongoDB. This tool is included with MongoDB installations. Execute the command as follows:
```shell
mongoimport --db your_database_name --collection your_collection_name --file data.json --jsonArray
```
Ensure that `data.json` is the file containing your transformed JSON data.
After importing, verify that the data in MongoDB matches the original data in IBM Db2. You can write queries in MongoDB to check the number of documents, fields, and sample data integrity. This step ensures that the migration process was successful and that the data is complete and accurate.
By following these steps, you can effectively transfer data from IBM Db2 to MongoDB without relying on third-party connectors or integrations.