Migrate from Contentful to MeshBase

Switch from Contentful to MeshBase and save significantly on costs while gaining more flexibility. This guide walks you through exporting your Contentful data and importing it to MeshBase.

Why Migrate from Contentful?

💰Cost Savings

Contentful pricing starts at $300/month. MeshBase offers similar features at a fraction of the cost.

🔓No Vendor Lock-in

MeshBase gives you full control. Export your data anytime, no restrictions.

Simpler API

REST API that's easier to work with. No complex GraphQL queries required.

🛠️Developer-Friendly

Better DX, clearer documentation, faster support response times.

Migration Overview

The migration process has three main steps:

1

Export from Contentful

Use Contentful's CLI to export your content model and entries

2

Transform Data

Convert Contentful's structure to MeshBase format

3

Import to MeshBase

Use MeshBase API to create content types and import entries

Step 1: Export from Contentful

Install Contentful CLI

npm install -g contentful-cli

Export your space

contentful space export \
  --space-id your-space-id \
  --management-token your-token \
  --export-dir ./contentful-export

This creates a JSON file with all your content types and entries.

Step 2: Transform Data

Use our migration script to convert Contentful data to MeshBase format:

// migrate.js
const fs = require('fs');

// Read Contentful export
const contentful = JSON.parse(
  fs.readFileSync('./contentful-export/export.json', 'utf8')
);

// Transform content types
const meshbaseContentTypes = contentful.contentTypes.map(ct => ({
  name: ct.name,
  apiId: ct.sys.id,
  fields: ct.fields.map(field => ({
    name: field.name,
    type: mapFieldType(field.type),
    required: field.required || false
  }))
}));

// Transform entries
const meshbaseEntries = contentful.entries.map(entry => ({
  contentType: entry.sys.contentType.sys.id,
  data: transformFields(entry.fields)
}));

function mapFieldType(contentfulType) {
  const typeMap = {
    'Symbol': 'text',
    'Text': 'richtext',
    'Integer': 'number',
    'Date': 'datetime',
    'Boolean': 'boolean',
    'Link': 'relation',
    'Array': 'array'
  };
  return typeMap[contentfulType] || 'text';
}

function transformFields(fields) {
  const result = {};
  for (const [key, value] of Object.entries(fields)) {
    result[key] = value['en-US'] || value;
  }
  return result;
}

// Save transformed data
fs.writeFileSync(
  './meshbase-import.json',
  JSON.stringify({ contentTypes: meshbaseContentTypes, entries: meshbaseEntries }, null, 2)
);

console.log('✅ Data transformed! Check meshbase-import.json');

Run the script:

node migrate.js

Step 3: Import to MeshBase

Create content types in MeshBase

Use the MeshBase dashboard or API to create matching content types.

💡

Manual vs Automated

For a few content types, use the MeshBase dashboard UI. For many content types, use the API to automate creation.

Import entries

// import.js
const data = require('./meshbase-import.json');

const API_URL = 'https://api.meshbase.io/v1';
const API_KEY = 'your-admin-api-key';

async function importEntries() {
  for (const entry of data.entries) {
    await fetch(`${API_URL}/${entry.contentType}`, {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${API_KEY}`,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify(entry.data)
    });
  }
  console.log('✅ Import complete!');
}

importEntries();

Field Type Mapping

Contentful and MeshBase use similar field types:

ContentfulMeshBaseNotes
SymboltextShort text
TextrichtextLong text/markdown
Integer/NumbernumberNumeric values
DatedatetimeISO 8601 format
BooleanbooleanTrue/false
LocationjsonStore as JSON object
MediamediaUpload to MeshBase first
LinkrelationReferences to other entries

After Migration

  • Update your application code

    Replace Contentful SDK calls with MeshBase API calls

  • Test thoroughly

    Verify all content displays correctly

  • Set up webhooks

    Replace Contentful webhooks with MeshBase webhooks

  • Cancel Contentful subscription

    Start saving money immediately!

Need Help?

We're here to help you migrate! Contact our support team for:

  • Custom migration scripts for complex content models
  • Assisted migration service (we handle it for you)
  • Questions about field mapping or data transformation