@openpanel/umami-exporter
v0.3.0
Published
Barebones Postgres CSV exporter for Umami events (no Prisma).
Maintainers
Readme
@openpanel/umami-exporter
Export your Umami data to a CSV which you can use for migrating to OpenPanel.dev.
Install / Run
Use npx with a Postgres URL:
npx @openpanel/umami-exporter "postgres://user:pass@host:5432/db" --output export.csv --job-id 00000000-0000-0000-0000-000000000000Or via env vars:
export DATABASE_URL="postgres://user:pass@host:5432/db"
export OUTPUT=export.csv
export JOB_ID=00000000-0000-0000-0000-000000000000
npx @openpanel/umami-exporterWrite to stdout:
npx @openpanel/umami-exporter "postgres://..." --output - > export.csvOutput format
Header and column order exactly:
"website_id","session_id","visit_id","event_id","hostname","browser","os","device","screen","language","country","region","city","url_path","url_query","utm_source","utm_medium","utm_campaign","utm_content","utm_term","referrer_path","referrer_query","referrer_domain","page_title","gclid","fbclid","msclkid","ttclid","li_fat_id","twclid","event_type","event_name","tag","distinct_id","created_at","job_id"
- All values are quoted except
event_typewhich is unquoted integer to match the sample. - Nulls are rendered as empty fields.
created_atis formatted asYYYY-MM-DD HH24:MI:SSfromwebsite_event.created_at.job_idis a constant per run (env/flag), appended to each row.
Flags
--output, -oOutput path; use-for stdout (default:export.csv)--job-idJob id to append to each row (default: all-zero UUID)--batch-sizeCursor batch size (default: 50000)
Notes
This package need access to your postgres database, by default, the port 5432 is not exposed in umami. You can expose it by adding (see below) to your docker-compose.yml and then restart it (docker compose restart)
ports:
- "5432:5432"Ensure you have correct user and password for your database. Umami's default database url is postgresql://umami:umami@localhost:5432/umami
