TutorialMarch 2025 · 10 min read

How to Sync Akeneo Products to MongoDB Atlas: Complete Tutorial

This tutorial walks through a complete Akeneo to MongoDB export — from creating an Atlas cluster to querying your first product documents. We'll cover Atlas setup, IP whitelisting, variant flattening, and incremental sync.

Akeneo's hierarchical data model and why MongoDB fits

Akeneo stores products in a tree structure. A configurable product like a t-shirt has:

Root Product Model:  "TSHIRT"          (color, material, description)
  Sub Product Model: "TSHIRT-BLUE"     (color: blue, images)
    Variant Product: "TSHIRT-BLUE-S"   (size: S, stock)  ← has SKU
    Variant Product: "TSHIRT-BLUE-M"   (size: M, stock)  ← has SKU
  Sub Product Model: "TSHIRT-RED"      (color: red, images)
    Variant Product: "TSHIRT-RED-S"    (size: S, stock)
    Variant Product: "TSHIRT-RED-M"    (size: M, stock)

MongoDB handles this naturally. Each variant becomes a document with all parent attributes resolved — no joins, no joins, no complex traversal at query time. Your Next.js storefront does a single findOne({sku: 'TSHIRT-BLUE-M'}) and gets everything it needs to render a product page.

Setting up MongoDB Atlas and whitelisting SyncPIM IPs

  1. 1

    Create Atlas cluster

    Go to cloud.mongodb.com → Create a New Cluster. The M0 free tier works for testing. For production, M10+ is recommended.

  2. 2

    Create database user

    Security → Database Access → Add New Database User. Username/Password auth. Give it readWrite permission on your target database.

  3. 3

    Get connection string

    Overview → Connect → Connect your application → Copy the mongodb+srv:// string. Replace <password> with your user password.

  4. 4

    Whitelist SyncPIM IPs

    Security → Network Access → Add IP Address. Get SyncPIM's IP ranges from your dashboard (Settings → IP Ranges). Add each range.

  5. 5

    Test connection

    In SyncPIM, create a new destination, paste the connection string, click Test Connection. Green checkmark = ready.

Configuring SyncPIM for MongoDB export

In the SyncPIM dashboard, create a new export configuration:

  1. 1. Source: Enter your Akeneo URL, Client ID, Secret, Username, Password. Click "Test Akeneo connection".
  2. 2. Destination: Select MongoDB. Paste your Atlas connection string. Enter database name (e.g., catalog) and collection name (e.g., products).
  3. 3. Channel & locale: Select your Akeneo channel (e.g., ecommerce) and locale(s) to export.
  4. 4. Enrichers (optional): Add a slug enricher to compute url fields from product names. See the enrichment guide.
  5. 5. Run: Click Run Export. Watch the live progress counter in the dashboard.

Querying your exported product documents

// MongoDB Shell / Compass queries after export

// Find a product by SKU
db.products.findOne({ sku: "TSHIRT-BLUE-M" })

// Get all products in a category
db.products.find({ categories: "summer-collection" })

// Full-text search on name (requires text index)
db.products.createIndex({ "name.en_US": "text" })
db.products.find({ $text: { $search: "blue t-shirt" } })

// Get products with price above 50 EUR
db.products.find({
  "price": { $elemMatch: { amount: { $gt: "50" }, currency: "EUR" } }
})

// Count products by family
db.products.aggregate([
  { $group: { _id: "$family", count: { $sum: 1 } } },
  { $sort: { count: -1 } }
])

Keeping MongoDB in sync with incremental exports

After your initial export, enable incremental sync in SyncPIM. Set the frequency: hourly (Professional plan) or daily (Essential plan).

SyncPIM uses Akeneo's updated_after filter to fetch only changed products. Changed products are upserted in MongoDB (matched by Akeneo UUID _id). New products are inserted, existing ones are overwritten.

Verify sync is working: After a scheduled run, check the SyncPIM dashboard for the last run timestamp and row count. In MongoDB, verify with:db.products.find({}).sort({updatedAt: -1}).limit(5)

Try it with your Akeneo catalog

10 free exports. No credit card. Full Atlas support including free M0 clusters.

Related