Skip to content

Openpanel-dev/plausible-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@openpanel/plausible-exporter

Export your Plausible ClickHouse data to a CSV which you can use for migrating to OpenPanel.dev.

Install / Run

Use npx with a ClickHouse URL:

npx @openpanel/plausible-exporter "http://localhost:8123/plausible_events_db" --output export.csv --job-id 00000000-0000-0000-0000-000000000000

Filter by site_id:

npx @openpanel/plausible-exporter "http://localhost:8123/plausible_events_db" --site-id 2 --output export.csv

Or via env vars:

export DATABASE_URL="http://localhost:8123/plausible_events_db"
export OUTPUT=export.csv
export JOB_ID=00000000-0000-0000-0000-000000000000
export SITE_ID=2  # optional
npx @openpanel/plausible-exporter

Output format

Header and column order:

"timestamp","name","site_id","user_id","session_id","hostname","pathname","referrer","referrer_source","country_code","country_name","screen_size","operating_system","browser","utm_medium","utm_source","utm_campaign","utm_content","utm_term","browser_version","operating_system_version","subdivision1_code","subdivision1_name","subdivision2_code","city_geoname_id","city_name","revenue_reporting_amount","revenue_reporting_currency","revenue_source_amount","revenue_source_currency","channel","meta.key","meta.value","job_id"

  • All values are quoted and escaped per RFC4180 CSV format.
  • Null values are rendered as empty fields.
  • timestamp is the event timestamp from events_v2.timestamp.
  • country_name, subdivision1_name, and city_name come from JOINs with location_data table.
  • meta.key and meta.value are JSON stringified arrays from events_v2.meta.key and events_v2.meta.value.
  • job_id is a constant per run (env/flag), appended to each row.

Flags

  • --output, -o Output file path (default: export.csv)
  • --job-id Job id to append to each row (default: empty string)
  • --site-id Filter by site_id (optional, exports all sites if not specified)
  • --batch-size Number of rows per paginated query (default: 50000)

Notes

This package needs access to your ClickHouse database. The connection string format is:

http://[username:password@]host:port/database

Examples:

  • http://localhost:8123/plausible_events_db
  • http://user:[email protected]:8123/plausible_events_db

The exporter queries the events_v2 table and joins with location_data to include country, region, and city names. It does not include imported data tables.

Ensure you have correct credentials and that the ClickHouse server is accessible from your network.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published