If your store runs on a legacy AfterAds (cc.afterads.com on Cloudflare KV), this guide takes you to v2 on Postgres + Drizzle.

#What changes

"v1"v2
StorageCloudflare KVSupabase Postgres
Schemakey/valueDrizzle ORM
AuthAPI keys onlyBetter Auth + cookies + tokens
TrackingSyncAsync + queue
StudioNot availableAvailable
LoyaltyNot availableAvailable

#Migration steps

  1. 1

    Export from v1. node scripts/kv-export.mjs dumps the namespace.

  2. 2

    Inspect the export. A JSON file with customers + stores + events.

  3. 3

    Sign up on v2. /auth/sign-up.

  4. 4

    Import into v2. node --env-file=.env.local scripts/kv-import.mjs --dry to validate, then drop --dry.

  5. 5

    Verify counts. /admin/customers and /admin/stores should match expected.

#Needs reconfiguration

  • API keys — v1 keys don't work on v2. Generate new ones.
  • Webhooks — endpoint URLs changed. Update in your dashboard.
  • Studio access — Studio is brand new. Start at /studio.

#Post-migration verification

CheckCommandExpected
Customers countSELECT COUNT(*) FROM customersmatch v1 export
Stores linkedSELECT COUNT(*) FROM stores WHERE customer_id IS NOT NULL≥ 95% of v1
Events archivedcheck tracking_events table≥ 90% of v1

#Help