Skip to content

Instantly share code, notes, and snippets.

@ak--47
Last active January 2, 2024 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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 peopleExport --secret $SOURCE_SECRET && npx --yes mixpanel-import ./mixpanel-exports/ --type user --token $TARGET_TOKEN --secret $TARGET_SECRET --fixData --format json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment