Get an instance started

Install docker & docker-compose, then write down docker-compose.yml

version: '3'

services:

  piwik:
    image: piwik
    links:
      - mariadb:db
    ports:
      - "80:80"
    volumes:
      - ./piwik:/var/www/html

  mariadb:
    image: mariadb
    environment:
      - MYSQL_RANDOM_ROOT_PASSWORD=yes
      - MYSQL_DATABASE=piwik
      - MYSQL_USER=piwik
      - MYSQL_PASSWORD=piwik
    volumes:
      - ./database:/var/lib/mysql

Go to http://localhost and finish the web setup, with database being at db, piwik, piwik & piwik.

Import logs

Just so you can analyze stuff from a good ol' stupidly deprecated server (r)(tm). Note, in my case I created the targeted website while finishing the web setup.

  • Move your access logs files in ./piwik
  • Log in the piwik container via docker exec -ti $(dirname $(pwd))_piwik_1 bash
  • Install python : apt update; apt install -y python
  • Import the logs : python ./misc/log-analytics/import_logs.py --url=my.old.website.com --replay-tracking --url=localhost *access*. You might want to check --help for options related to your own case, like --enable-static in mine.
  • Force processing : ./console core:archive --force-all-websites --force-all-periods=315576000 --force-date-last-n=1000 --url='http://localhost'

You should be done, check the result