This is a script to backfill data in an Amplitude project based on a project export. See https://amplitude.zendesk.com/hc/en-us/articles/206404358-Self-Data-Backfill-Guide for their primer on the subject.
It uses https://github.com/fmmfonseca/work_queue to manage a pool of workers making batch HTTP requests.
- Export the data you want to import from Amplitude's project detail pane
- Unzip the data file and concatenate it:
unzip -p <src>.zip | gunzip -c > <target>.json
- For the project you want to import to. It's recommended to run the import against a test project first (assuming you have the bandwidth under your monthly events cap)
- Install dependencies:
bundle install
- Run the script:
API_KEY=<your API key> bundle exec ruby sample_import.rb <target>.json