# Migrate your analytics data from Amplitude

Migrate your product analytics from Amplitude to Statsig in three steps: export your raw events, transform them into Statsig's event format, then import them into your Statsig project. After your data lands in Statsig, you work in a single platform that combines analytics, experimentation, and feature flagging. This guide covers the essentials; for anything beyond these basics, contact Statsig.

## Step 1. Export your data from Amplitude

Amplitude offers a few different export methods. Pick the one that matches your data size and setup:

**1. S3 Export**

For high volume backfills, export your Amplitude data to an S3 bucket.

**2. Warehouse Export**

If your Amplitude data is already in Snowflake, BigQuery, or Redshift, you can skip file downloads. Statsig ingests directly from these warehouses (refer to Step 2.1).

**3. Export API**

Use Amplitude's Export API to pull gzipped JSON.

* **Limit**: 4 GB per request so use hourly windows for large ranges
* **Example**:

```bash
curl --location --request GET 'https://amplitude.com/api/2/export?start=<starttime>&end=<endtime>' \
-u '{api_key}:{secret_key}'
```

**4. UI Download (CSV/JSON)**

Go to Organization Settings → Project → Export Data.

* Best for small datasets or initial testing

## Step 2. Transform your data

Amplitude and Statsig store events in slightly different formats. Map your Amplitude data to Statsig's format before importing, regardless of which import method you use in Step 3.

| Amplitude field | Statsig field |
|-----------------|---------------|
| `event_type` | `event` |
| `event_time` | `timestamp` (ms since epoch) |
| `user_id` | `user.userID` |
| `device_id` | `user.stableID` |
| `event_properties` | `metadata` |
| `user_properties` | `user` fields |

**Before transform**

```json
// Amplitude event
{
  "event_type": "purchase",
  "user_id": "123",
  "device_id": "device_abc",
  "event_time": "2023-08-17T00:00:00Z",
  "event_properties": {
    "amount": 25,
    "currency": "USD"
  },
  "user_properties": {
    "plan": "premium"
  }
}
```

**After transform**

```json
// Statsig event
{
  "event": "purchase",
  "user": {
    "userID": "123",
    "stableID": "device_abc",
    "plan": "premium"
  },
  "timestamp": 1692230400000,
  "metadata": {
    "amount": 25,
    "currency": "USD"
  }
}
```

## Step 3. Import into Statsig

After your data is in Statsig event format, choose an import path based on how you exported:

| If you exported from Amplitude through... | Import into Statsig using... | Best when... |
|---------------------------------------|------------------------------|--------------|
| S3 export | S3 ingestion | You're backfilling large datasets |
| Warehouse (Snowflake/BQ/Redshift) | Warehouse ingestion | Your Amplitude data already lives in a warehouse |
| Export API | Event Webhook | You're moving a few days/weeks of data programmatically |
| UI download (CSV/JSON) | Event Webhook | You're testing or moving a small slice of data |

**S3 ingestion**

* Transform files to the Statsig schema in Parquet, JSON, or CSV format, then follow the [Statsig S3 ingestion](https://docs.statsig.com/data-warehouse-ingestion/s3) steps.
* Shard your Amplitude raw data into one day per directory before ingesting into Statsig.

**Warehouse ingestion**

* [Connect your warehouse to Statsig](https://docs.statsig.com/data-warehouse-ingestion/introduction).
* Point Statsig at a query that outputs events in the expected schema.
* Statsig ingests on a recurring schedule.

**UI download or Export API**

To get these events into Statsig, replay them through the [Event Webhook](https://docs.statsig.com/http-api/overview#post-event-webhook). Take each row or JSON object, reshape it to Statsig format, and send it one at a time or in small batches.

This approach is best for test runs or initial migrations, not for millions of events.

```bash
curl -X POST https://api.statsig.com/v1/webhooks/event_webhook \
-H "Content-Type: application/json" \
-H "STATSIG-API-KEY: $STATSIG_SERVER_SECRET" \
-d '{
  "event": "signup",
  "user": { "userID": "abc" },
  "timestamp": 1692230400000
}'
```

## Get migration help

If you're unsure how to approach this migration, contact the Statsig team. Statsig has worked closely with customers migrating from Amplitude and can provide hands-on support.

Reach out to the support team, your sales contact, or through the [Slack community](https://statsig.com/slack).
