matomo-org / matomo-org/plugin-Migration

Support Migration from On-Premise to Matomo for WordPress

Open
#26 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
PHP
Stars
7
Forks
11
Avg merge
4h 17m
Merged PRs (30d)
2

Description

This is currently not fully supported see https://matomo.org/faq/wordpress/how-do-i-migrate-all-my-data-from-matomo-on-premise-to-matomo-for-wordpress/

When Matomo for WordPress is installed, one site is created and a "link" to this site is created internally. All report data is shown for this linked idsite and all data is tracked into this linked site. When you click on "Matomo -> Reporting" in the WP admin dashboard, then this linked site will be opened.

When you migrate from Matomo On-Premise to Matomo for WordPress, the migration plugin will create a second site. You can only see the reports for this second site by following these steps: "Matomo Analytics -> Reporting -> Then selecting this different site in the site selector".

Matomo for WordPress does not allow you to edit or delete a site. This means this newly created second site cannot be edited or deleted. You can also not really track additional data into this migrated site unless you adjust the idSite in the tracking code manually.

To workaround this issue if you want to track data into this newly migrated site:

* Migrate the existing On-Premise site using this plugin
* Run this MySQL query in your database `update wp_options set option_value = 2 where option_name = "matomo-site-id-1"`. You may need to adjust the `wp_` database table prefix and the `option_value=2` to the correct idSite in case you ran the migration command multiple times
* What will happen now is:
* The tracking code will be automatically adjusted to use idSite=2 (unless the tracking code is configured manually)
* The reports in the "Matomo => Summary" page will show stats from this second site and clicking on "Matomo => Reporting" will open directly the second site.

**Notes:**
* You cannot merge previously tracked data with data from Matomo On-Premise into one site. If you tracked data into the first site before the migration, you cannot view this data anymore.
* We do not recommended migrating from Matomo On-Premise to Matomo for WordPress unless you have little traffic and want to have less maintenance work. Using Matomo On-Premise will be significantly faster and need less resources overall. You can also [see the difference between those Matomo On-Premise and Matomo for WordPress here](https://matomo.org/faq/wordpress/what-are-the-differences-between-matomo-on-premise-and-matomo-for-wordpress/)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the migration plugin's handling of the linked site, then trace the Matomo for WordPress Reporting entry point, tracking code, and the matomo-site-id-1 value in wp_options. Reproduce the migration and verify how the migrated site is selected for reports and tracking. Done should remove the need for a manual SQL update or tracking-code change.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, php, wordpress
Domain
backend, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.