While we export the data by api whose project is be created before 2023. That is the time in each event will be set in our project timezoon.But if we import direct to a new project.That will cause event number be double . How can we fix that issue?
Fixing Timezone Offset When Migrating Data from a Pre-2023 Project
You're correct about the issue. For projects created before January 1, 2023, event timestamps are stored in the project's local timezone (not UTC). When you export this data and import it directly into a new project (which stores data in UTC), the timestamps will be misinterpreted, causing events to appear at wrong times โ and potentially doubling up counts across day boundaries. Here's how to fix it:
Step 1: Convert Timestamps to UTC Before Importing
Before importing into the new project, you must convert the exported timestamps from your old project's timezone to UTC.
"When you export raw event data, the timestamps on those events will be in the timezone of your project. Before importing into your new project, convert those timestamps to UTC so that they are correctly transformed to the timezone of the new project." [Merge Projects]
Step 2: Regenerate $insert_id Values
If you're re-importing data that was previously soft-deleted or already partially imported, regenerate the $insert_id for each event. If you reuse the same $insert_id, Mixpanel's deduplication system may discard your new (corrected) events in favor of the old ones. [Data Clean-Up]
Step 3: Use $insert_id for Deduplication
When importing, ensure every event has a unique $insert_id. This is Mixpanel's primary mechanism to prevent duplicate events from being stored. [Backfilling Historical Data]
Optional: Use mixpanel-utils Library
If you're using the open-source mixpanel-utils library, you can specify the timezone offset directly during import to handle the conversion automatically:
mputils.import_events('event_export.txt', timezone_offset=-8)The timezone_offset parameter should reflect your old project's UTC offset (e.g., -8 for PST). [mixpanel-utils]
Summary Checklist
Step | Action |
1 | Export data from old project via Raw Export API |
2 | Convert timestamps from project timezone โ UTC |
3 | Regenerate $insert_id values |
4 | Import into new project via Import API |
5 | Validate event counts match expected totals |
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Fixing Duplicate Data Caused by Incorrect Timestamps
You're describing a situation where your project now has two copies of the same events โ the original exported data (with project timezone timestamps) and the re-imported data (also with project timezone timestamps, unconverted). Even though they share the same $insert_id, the different timestamps make Mixpanel treat them as distinct events, bypassing deduplication.
Why This Happens
Mixpanel's deduplication uses a combination of event_name, time, distinct_id, and insert_id together. [Common SQL Queries] If the time value differs between the original and re-imported event, they are treated as different events even with the same $insert_id.
How to Fix It
The recommended approach is to delete the problematic imported data and re-import it correctly:
Step 1: Delete the Duplicate Events
Use Mixpanel's Data Deletion tool to remove the incorrectly imported events. You can target them using event property filters to isolate only the duplicates. [Deleting Problematic Data]
Note the eligibility requirements for Data Deletion:
You must be an Owner or Admin
Data must be within the past 180 days
Project must be under 5 billion events/month
No more than 10 deletes in the past calendar month
Step 2: Wait for Hard Deletion
Data Deletion first performs a soft delete (immediately hidden) before a hard delete (permanently removed from servers). You must wait for the hard delete to complete before re-importing.
Step 3: Re-import with Correct UTC Timestamps + New $insert_id
When re-importing:
Convert timestamps to UTC from your old project's timezone
Regenerate $insert_id values to avoid collision with soft-deleted events
"If you re-import data while the data is soft deleted with the same $insert_id, our deduplication systems may keep the old (deleted) event and toss the new event." [Data Clean-Up]
Summary
Step | Action |
1 | Use Data Deletion to remove the incorrectly imported duplicates |
2 | Wait for hard deletion to complete |
3 | Convert timestamps to UTC |
4 | Regenerate $insert_id values |
5 | Re-import the corrected data |
If your data exceeds the Data Deletion eligibility limits, you may need to contact Mixpanel Support directly for assistance.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
