Migrate from PostHog
The calls map almost one to one, so most apps switch in an afternoon. A safe path: add TraceIQ next to PostHog, compare the numbers for a week, import your history, then remove PostHog.
1. Swap the SDK calls
On the server, posthog-node maps to traceiq-node:
// Before
posthog.capture({ distinctId: user.id, event: 'payout_succeeded', properties: { amount } });
await posthog.shutdown();
// After
import { TraceIQ } from 'traceiq-node';
const traceiq = new TraceIQ({ projectId: 'YOUR_PROJECT_ID', writeKey: process.env.TRACEIQ_WRITE_KEY!, endpoint: 'https://api.traceiq.run' });
traceiq.capture({ userId: user.id, event: 'payout_succeeded', properties: { amount } });
await traceiq.shutdown();2. Import your history
TraceIQ can pull your events straight from PostHog. In PostHog, create a personal API key with the batch_export:read and batch_export:write scopes, and note your project ID (the number after /project/ in the PostHog URL). Events keep their original timestamps and locations, so funnels, retention and trends cover the period before you switched.
From the dashboard: open Import (under Integrations), choose your PostHog region, paste the project ID and key, pick a date range, and click Check connection, then Start import. The import runs on TraceIQ’s servers, so you can close the page; progress shows on the Import page. The PostHog key is used only while the import runs and is never stored. If an import stops, Continue from fills in the form from where it got to.
From the terminal: log in with a personal access token that has the imports:write scope, then:
npx traceiq-cli login export POSTHOG_PERSONAL_API_KEY=phx_... npx traceiq-cli import posthog --project YOUR_PROJECT_ID --posthog-project 12345 --posthog-host us --since 2025-01-01 --dry-run npx traceiq-cli import posthog --project YOUR_PROJECT_ID --posthog-project 12345 --posthog-host us --since 2025-01-01
Either way, TraceIQ asks PostHog for a file download export of each week in the range (PostHog’s limit per export), waits for it, downloads it and imports it. Use the EU region (--posthog-host eu) or your own URL if you self-host. PostHog bills these exports per exported row, so events TraceIQ would skip anyway are left out of the export. --dry-run and Check connection verify the key and project without starting an export.
Already have an export file? Upload it on the Import page, or run npx traceiq-cli import posthog events.jsonl. JSON Lines (gzipped or not), a JSON array of events, and TraceIQ’s own JSON export are all accepted.
$pageview, $screen— Imported as $page, with URL, path, referrer, title and UTM tags.$identify, $set— Imported as $identify; person properties become traits.$create_alias— Imported as $alias.your own events— Imported under the same name. PostHog’s $-prefixed metadata properties are dropped; browser, OS and device go to device info.skipped— $autocapture, $pageleave, $feature_flag_called, $exception and other PostHog-internal events. Old exceptions are skipped so they don’t reopen issues or fire alerts. The CLI lists everything it skipped.
Imported events count toward your monthly event allowance. They don’t trigger webhooks, and they keep PostHog’s location data rather than the location of whoever runs the import. Only owners and admins can import. Imports are not de-duplicated: importing the same date range twice stores its events twice. If you run both SDKs side by side first, export PostHog only up to the day TraceIQ went live.
3. Recreate what isn’t data
Dashboards, insights, funnels, cohorts, feature flags, experiments and surveys are definitions, not events, so the importer does not move them. Recreate the ones you still use (the MCP server can create funnels, cohorts, flags and dashboards for you). Session recordings stay in PostHog.

