Hero
Back to all guides

How to migrate from Mixpanel to OpenPanel

Switch from Mixpanel to OpenPanel in under 2 hours with this step-by-step migration guide.

OpenPanel Team

12/15/2025

Intermediate
90 min

How to migrate from Mixpanel to OpenPanel

Migrating analytics tools sounds painful, but OpenPanel's API closely mirrors Mixpanel's patterns. Most implementations translate with minimal code changes. You'll map your existing events, optionally import historical data, and run both tools in parallel before cutting over.

OpenPanel gives you better privacy controls with cookieless tracking by default, transparent pricing without surprise overages, and the option to self-host. The migration typically takes 1-2 hours for code changes, plus a week or two of parallel tracking to verify data consistency.

Prerequisites

  • An existing Mixpanel implementation
  • An OpenPanel account (sign up free)
  • Access to your Mixpanel project settings for data export
  • Access to your application codebase

Export Mixpanel data

Before migrating, you'll want to export your historical data from Mixpanel. This step is optional if you're okay starting fresh, but most teams prefer to preserve their historical events for comparison.

Mixpanel provides an export API that returns events in JSON format. You'll need your API credentials from Project Settings in Mixpanel.

curl https://mixpanel.com/api/2.0/export \
  -u YOUR_API_SECRET: \
  -d 'from_date=2024-01-01' \
  -d 'to_date=2024-12-15' \
  -d 'event=["event1","event2"]' \
  > mixpanel_export.json

Alternatively, you can export through Mixpanel's dashboard by navigating to Data Management, then Export. Select your date range and events, then download the file. Keep this export handy for the import step later.

Install OpenPanel SDK

Install the OpenPanel SDK alongside Mixpanel. You'll remove Mixpanel later after verifying the migration.

For web applications, install the web SDK. This handles browser-specific features like automatic page view tracking and outgoing link tracking.

npm install @openpanel/web

For server-side applications or Node.js, use the core SDK instead. This version requires a client secret and is meant for trusted environments.

npm install @openpanel/sdk

If you're using Next.js, there's a dedicated package that handles both client and server tracking with proper component integration. Check the SDK documentation for framework-specific setup.

Map your events

OpenPanel's API follows similar patterns to Mixpanel, with a few naming convention differences. Mixpanel uses Title Case for events and properties, while OpenPanel uses snake_case.

Here's how basic event tracking translates. In Mixpanel, you might track a button click like this:

mixpanel.track('Button Clicked', {
  'Button Name': 'Sign Up',
  'Button Location': 'Hero'
});

The equivalent in OpenPanel uses snake_case naming:

op.track('button_clicked', {
  button_name: 'Sign Up',
  button_location: 'Hero'
});

User identification works similarly, but OpenPanel uses a structured object instead of separate method calls. Mixpanel's pattern splits identify and people.set:

mixpanel.identify('user_123');
mixpanel.people.set({
  '$email': 'user@example.com',
  '$name': 'John Doe',
  'Plan': 'Premium'
});

OpenPanel combines this into a single identify call with built-in fields for common properties:

op.identify({
  profileId: 'user_123',
  email: 'user@example.com',
  firstName: 'John',
  lastName: 'Doe',
  properties: {
    plan: 'Premium'
  }
});

For super properties (global properties that attach to every event), Mixpanel uses register or registerSuperProperties. OpenPanel calls this setGlobalProperties, but the concept is identical:

op.setGlobalProperties({
  app_version: '1.0.0',
  environment: 'production'
});

Incrementing user properties works the same way, just with different method names:

op.increment({
  profileId: user.id,
  property: 'login_count',
  value: 1
});

Import historical data

OpenPanel can import your Mixpanel export using the SDK's server-side client. You'll need to transform the Mixpanel format slightly since Mixpanel uses Unix timestamps and different property names.

import { OpenPanel } from '@openpanel/sdk';

const op = new OpenPanel({
  clientId: 'YOUR_CLIENT_ID',
  clientSecret: 'YOUR_CLIENT_SECRET',
});

const mixpanelEvents = await loadMixpanelExport();

for (const event of mixpanelEvents) {
  op.track(event.event, event.properties, {
    profileId: event.distinct_id,
    timestamp: new Date(event.time * 1000),
  });
}

For user profiles, map Mixpanel's dollar-prefixed properties to OpenPanel's built-in fields:

const mixpanelUsers = await loadMixpanelUsers();

for (const user of mixpanelUsers) {
  op.identify({
    profileId: user.distinct_id,
    email: user.$email,
    firstName: user.$first_name,
    lastName: user.$last_name,
    properties: {
      plan: user.Plan,
      signupDate: user['Signup Date'],
    },
  });
}

For large migrations, contact support. OpenPanel has tooling to help with bulk imports.

Run in parallel

Before removing Mixpanel, run both tools simultaneously for 1-2 weeks. This lets you verify that event counts match and user identification is working correctly.

Create a simple wrapper function that sends events to both platforms:

function trackEvent(eventName, properties) {
  if (typeof mixpanel !== 'undefined') {
    mixpanel.track(eventName, properties);
  }
  
  if (op) {
    op.track(eventName, properties);
  }
}

trackEvent('button_clicked', { button_name: 'Sign Up' });

After a week, compare Mixpanel's Live View with OpenPanel's real-time dashboard. Check that event counts are close (they won't be exact due to timing differences), user profiles are being created correctly, and any funnels you've set up show similar conversion rates.

Remove Mixpanel

Once you've verified data consistency, remove the Mixpanel SDK from your project. For npm packages, uninstall the dependency:

npm uninstall mixpanel-browser

Then search your codebase for any remaining mixpanel.* calls and replace them with the OpenPanel equivalents. If you were using the wrapper function from the parallel tracking step, you can now remove it and call OpenPanel directly.

op.track('button_clicked', { button_name: 'Sign Up' });

Don't forget to remove any Mixpanel script tags if you were loading their SDK via CDN.

Verify your setup

After removing Mixpanel, monitor OpenPanel for a few days to ensure everything is tracking correctly. Check the real-time view to confirm events are flowing, verify that user profiles show the expected properties, and test any funnels or reports you've configured.

If events aren't appearing, double-check that you're using the correct client ID and that the SDK is initialized before any tracking calls. The browser console will show network requests to api.openpanel.dev if tracking is working.

Next steps

The SDK documentation covers advanced features like custom event properties, server-side tracking, and framework-specific integrations. If you're coming from Mixpanel because of pricing concerns, you might also want to explore self-hosting for complete control over your data and costs.

For framework-specific setup instructions, check out our guides:

Loved by builders everywhere

From indie hackers to global teams, OpenPanel helps people understand their users effortlessly.

  • Steven Tey
    Steven Tey
    @steventey

    Open-source Mixpanel alternative just dropped → http://git.new/openpanel

    It combines the power of Mixpanel + the ease of use of @PlausibleHQ into a fully open-source product.

    Built by @CarlLindesvard and it’s already tracking 750K+ events 🤩

  • Pontus Abrahamsson - oss/acc
    Pontus Abrahamsson - oss/acc
    @pontusab

    Thanks, OpenPanel is a beast, love it!

  • Piotr Kulpinski
    Piotr Kulpinski
    @piotrkulpinski

    The Overview tab in OpenPanel is great. It has everything I need from my analytics: the stats, the graph, traffic sources, locations, devices, etc.

    The UI is beautiful ✨ Clean, modern look, very pleasing to the eye.

  • greg hodson 🍜
    greg hodson 🍜
    @h0dson

    i second this, openpanel is killing it

  • Jacob 🍀 Build in Public
    Jacob 🍀 Build in Public
    @javayhuwx

    🤯 wow, it's amazing! Just integrate @OpenPanelDev into http://indiehackers.site last night, and now I can see visitors coming from all round the world.

    OpenPanel has a more beautiful UI and much more powerful features when compared to Umami.

    #buildinpublic #indiehackers

  • Lee
    Lee
    @DutchEngIishman

    Day two of marketing.

    I like this upward trend..

    P.S. website went live on Sunday

    P.P.S. Openpanel by @CarlLindesvard is awesome.

Ready to understand your users better?
Start tracking in minutes

Join thousands of companies using OpenPanel. Free 30-day trial, no credit card required. Self-host for free or use our cloud.

Get started now