Skip to content

Instantly share code, notes, and snippets.

@ak--47
Last active July 4, 2024 19:27
Show Gist options
  • Save ak--47/05d73181bf85d4b47317dee9d16aed4d to your computer and use it in GitHub Desktop.
Save ak--47/05d73181bf85d4b47317dee9d16aed4d to your computer and use it in GitHub Desktop.
reload mixpanel data
# reload all EVENTS from one project to another
# environment variables
# CUSTOMIZE THESE 👇
export START=2023-01-01
export END=2023-05-31
export SOURCE_SECRET=my-source-project-secret
export TARGET_SECRET=my-target-project-secret
# export → import
npx --yes mixpanel-import --type export --start $START --end $END --secret $SOURCE_SECRET && npx --yes mixpanel-import ./mixpanel-exports/ --secret $TARGET_SECRET
##############################
# reload all USER PROFILES from one project to another
# environment variables
# CUSTOMIZE THESE 👇
export SOURCE_SECRET=my-source-project-secret
export TARGET_SECRET=my-target-project-secret
export TARGET_TOKEN=my-target-project-token
# export → import
npx --yes mixpanel-import --type profile-export --secret $SOURCE_SECRET && npx --yes mixpanel-import ./mixpanel-exports/ --type user --token $TARGET_TOKEN --secret $TARGET_SECRET --fixData --format json
@ak--47
Copy link
Author

ak--47 commented Jul 4, 2024

please note... if either your source OR your target projects are using EU residency, please pass the:

--region EU

flag to the corresponding project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment