Skip to content

Instantly share code, notes, and snippets.

@ak--47
Created April 12, 2024 17:51
Show Gist options
  • Save ak--47/6a9dec04605209be60cc6f30c4134833 to your computer and use it in GitHub Desktop.
Save ak--47/6a9dec04605209be60cc6f30c4134833 to your computer and use it in GitHub Desktop.
Amplitude → Mixpanel
#!/bin/bash
# move data from Amplitude to Mixpanel
# by AK ([email protected])
# set env vars (customize these!)
export START_DATE=2023-04-20
export END_DATE=2023-04-20
export AMPLITUDE_KEY=my_key
export AMPLITUDE_SECRET=my_secret
export MIXPANEL_TOKEN=my_key
# export data from Amplitude
echo "Exporting data from Amplitude...\n\n"
npx amp-ext --key $AMPLITUDE_KEY --secret $AMPLITUDE_SECRET --start $START_DATE --end $END_DATE --unit day
# import EVENT data into Mixpanel
echo "Importing EVENT to Mixpanel...\n\n"
npx mixpanel-import ./exports/ --token $MIXPANEL_TOKEN --vendor amplitude
# import USER data into Mixpanel
echo "Importing USER to Mixpanel...\n\n"
npx mixpanel-import ./exports/ --token $MIXPANEL_TOKEN --vendor amplitude --type user --dedupe --fix
# clean up
echo "deleting local Amplitude dat..\n\n"
rm -rf ./exports
echo "all done!"
@ak--47
Copy link
Author

ak--47 commented Apr 12, 2024

usage:

sh amp-to-mp.sh

should look like this:
Amplitude-To-Mixpanel

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