Created
April 12, 2024 17:51
-
-
Save ak--47/6a9dec04605209be60cc6f30c4134833 to your computer and use it in GitHub Desktop.
Amplitude → Mixpanel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
usage:
should look like this: