plausible / community-edition

Example Docker Compose setup for hosting Plausible Community Edition

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

v2.0.0-rc.0

ruslandoga opened this issue · comments

This issue is used to track the next self-hosted release.

The highlights of this release are:

Upgrading Plausible Analytics to v2.0

⚠️ ⚠️ ⚠️

Upgrading to v2.0 requires performing a data migration.
Please read these notes till the end before deploying v2.0.0-rc.0

Update image tag

In your docker-compose.yml update the image used for plausible to v2.0.0-rc.0

plausible:
- image: plausible/analytics:v1.5.1
+ image: plausible/analytics:v2.0.0-rc.0

and restart the container

$ cd hosting
$ docker compose stop plausible
$ docker compose rm plausible
$ docker compose up -d

This will boot up the new version of the app.

If you open the dashboards now, you wouldn't see any past metrics. This is expected as v2.0 uses new events_v2 and sessions_v2 tables to store analytics data. We need to move data from old tables and for that we perform the next step.

Run data migration

⚠️ ⚠️ ⚠️

You need enough disk space available for x2 current plausible_events_db's event-data volume size. You can use something like docker system df -v | grep hosting_event-data to check how much space the current volume is occupying.

Connect to the running plausible container and start the migration flow

$ cd hosting
$ docker compose exec plausible bin/plausible rpc Plausible.DataMigration.NumericIDs.run

You can attempt this migration multiple times (unless you perform the next step).

Drop v1 tables (optional)

Once you verify the migration went well, the old tables can be dropped. It's easiest to use clickhouse-client for this

$ ch hosting
$ docker compose exec plausible_events_db clickhouse-client
:) \c plausible_events_db
:) show tables;
:) drop table events;
:) drop table sessions;

See https://clickhouse.com/docs/en/operations/server-configuration-parameters/settings#max-table-size-to-drop for how to drop tables with more than 50GB of data.

Enable automatic MaxMind GeoLite2 updates (optional)

In your plausible-config.env set MAXMIND_LICENSE_KEY environment variable and get an automatically updated GeoLite2 City geolocation database. The database edition is configurable with MAXMIND_EDITION environment variable and defaults to GeoLite2-City.

+ MAXMIND_LICENSE_KEY=LNpsJCCKPis6XvBP
+ MAXMIND_EDITION=GeoLite2-City

Now you can remove any other volumes and services used to download, store, and update geolocation databases.

Changelog

Following changes have been made since v1.5:

Added

  • Ability to use '--' instead of '=' sign in the tagged-events classnames
  • 'Last updated X seconds ago' info to 'current visitors' tooltips
  • Add support for more Bamboo adapters, i.e. Bamboo.MailgunAdapter, Bamboo.MandrillAdapter, Bamboo.SendGridAdapter plausible/analytics#2649
  • Ability to change domain for existing site (requires numeric IDs data migration, instructions will be provided separately) UI + API (PUT /api/v1/sites)

Fixed

Changed

Removed

  • Remove Firewall plug and IP_BLOCKLIST environment variable
  • Remove the ability to collapse the main graph plausible/analytics#2627

v2.0.0-rc.0 plausible/analytics#2896 has been published.