# DynamoDB Export Details

## Completed 2026-02-22

The DynamoDB table was exported and transferred to the dev account:

- **Pipeline entry point**: `s3://dev-mymac80/resonance-engine/ddb-export/01771804222395-8dd0c6a7/`
- **Manifest**: `manifest-summary.json`, `manifest-files.json` (5 data files)
- **Data**: 263,471 total records, **159,316 spotify-presave records** with `refreshToken` + `spotifyUserId`
- **Format**: DynamoDB JSON (`.json.gz` compressed)
- **Local backup**: Cleaned up (was `/tmp/ddb-export/`)

## How the Export Was Done

1. `awsume songwhip` → assume role in Songwhip prod account (`926734670777`)
2. `aws dynamodb export-table-to-point-in-time` → exported to `s3://prod-songwhip-bucket/dynamodb-exports/resonance-engine/`
3. Downloaded locally, then `aws s3 sync` to `s3://dev-mymac80/` under dev creds (`awsume aws_dev`)
4. Cleaned up the Songwhip prod bucket export (sensitive data)

## Record Types in the Export

| Type | Sort Key Pattern | Count | Notes |
|------|-----------------|-------|-------|
| `spotify-presave` | `task:spotify-presave-{userId}` | 159,316 | Has `refreshToken`, `spotifyUserId` — pipeline target |
| `group` | `group:album{id}` | — | Album group metadata with counters |
| `email-notification` | `task:email-notification-{hash}` | — | Email subscription tasks (encrypted) |
| `apple-music-presave` | `task:apple-music-presave-{id}` | — | Apple Music tokens |

**Pipeline takes over from S3** — The Manifest Parser and Collector Worker read `.json.gz` files from the dev bucket, filtering for `spotify-presave` records.

**Note:** EventBridge + Step Functions orchestration for automated DDB exports is deferred until direct DynamoDB access is available (either via cross-account IAM or when the dedicated account is provisioned).
