A small utility that migrates data from an Amplitude project to a PostHog project written in Node.js
ISC License
A small utility that migrates data from an Amplitude project to a PostHog project.
See the TODO section for status.
Clone the GitHub project:
git clone [email protected]:leggetter/migrate-amplitude-to-posthog.git && cd migrate-amplitude-to-posthog
Install the project dependencies:
npm install
Configure the utility via the guided prompts by running the following command:
node src/index.js config
See the Amplitude docs on getting your API credentials for the AMPLITUDE_API_KEY
and AMPLITUDE_API_SECRET
.
The Amplitude export start and end dates should be in the format MM/DD/YYYY
.
You can find your PostHog project API key within your Project settings.
Configuration is stored in migration.conf
.
Once the utility has been setup with the required configuration you can run additional commands:
Usage: index [options] [command]
Options:
-h, --help display help for command
Commands:
config Checks for any missing required configuration. Prompts when
required configuration is missing. Configuration is stored in
migration.conf in the working directory.
full-migration Performs a full Amplitude export, file unzipping and JSON
file setup, and PostHog event import.
unzip-only <export-zip-path> Unzipped the Amplitude export zip file and sets up the JSON
files ready for the PostHog import. Request an export zip file.
posthog-import-only <json-directory-path> Imports the JSON files from the Amplitude export into
PostHog. Requires the JSON files.
help [command] display help for command
You can use the full-migration
command to walk through the full migration from Amplitude to PostHog.
If the Amplitude export times out try the steps in the Partially automated section.
The Amplitude export can timeout for large exports so you may be better taking a multi-step approach to the process.
export.zip
file.export.zip
file to a working directory.cd path/to/dir/containing/export/zip
).unzip-only path/to/export.zip
. You will be prompted for some configuration (note: some config isn't require for this command). This will create a json
directory within that working folder with all the events that are to be imported to PostHog.posthog-import-only path/to/json
(the json
directory that was just created)Sent 61590 events to PostHog (2554 of which were alias events) from 2520 JSON files in 58 batch requests.