Export your Plausible ClickHouse data to a CSV which you can use for migrating to OpenPanel.dev.
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-000000000000Filter by site_id:
npx @openpanel/plausible-exporter "http://localhost:8123/plausible_events_db" --site-id 2 --output export.csvOr 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-exporterHeader 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.
timestampis the event timestamp fromevents_v2.timestamp.country_name,subdivision1_name, andcity_namecome from JOINs withlocation_datatable.meta.keyandmeta.valueare JSON stringified arrays fromevents_v2.meta.keyandevents_v2.meta.value.job_idis a constant per run (env/flag), appended to each row.
--output, -oOutput file path (default:export.csv)--job-idJob id to append to each row (default: empty string)--site-idFilter by site_id (optional, exports all sites if not specified)--batch-sizeNumber of rows per paginated query (default: 50000)
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_dbhttp://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.