Code Monkey home page Code Monkey logo

plugin-migration's People

Contributors

akuukis avatar altamashshaikh avatar mattab avatar sgiehl avatar snake14 avatar starker3 avatar tsteur avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plugin-migration's Issues

Import into existing site

Hi everybody,

I have to separate Matomo installations. Each of them with about 30 to 40 configured sites. I now would like to merge the two installations into one and found your tool.

As far as I understood, your tool always creates a new site when migrating site data from "source" to "target"? So I only can change the tracking URLs after migrating the data. Unfortunately, this would cause a loss of data in the timespan between "creating the site in the target Matomo installation" and "updating the tracking code to the new URL".

My idea would be ...

  1. configure the site in the target Matomo installation
  2. change the tracking URLs on my websites
  3. migrate old data from "source" to correspondending/existing site in "target"

In this way, I would not have any timespan with data loss. Or are there any other recommended workflows to switch from one installation to another?

Error when installing plugin: Inexistent Matomo version required

After trying plugin-Migration v3.0.5 ZIP upload to Matomo 3.13.1 (DE), an error occured:
"Error in Matomo: Bitte aktualisieren Sie Matomo 3.13.1 auf eine neuere Version, Matomo >=4.0.0-b1,<5.0.0-b1 wird ben\xc3\xb6tigt., "
("Please update to a newer version, Matomo >=4.0.0-b1,<5.0.0-b1 is required")
But there´s no Matomo version >=4!

Integrity constraint violation: 1062 Duplicate entry ...

We are trying to migrate a really old piwik site (id 60) to a clean matomo instance.
We're using the following command (after we had to install the plugin "Custom Opt Out" since the plugin changes the columns in the table matomo_site (custom_css, custom_css_file, custom_js, custom_js_file)):

./console migration:measurable --source-idsite=60 --target-db-host=example.de --target-db-username=example --target-db-password=example --target-db-name=example --target-db-prefix=matomo_ --skip-logs --disable-db-transactions

After some older archive tables we're getting the following output:

Starting to migrate archive table piwik_archive_numeric_2014_08 at 2019-02-18 16:15:17
Migrated archive table archive_numeric_2014_08 at 2019-02-18 16:15:27
Starting to migrate archive table piwik_archive_numeric_2014_09 at 2019-02-18 16:15:27



  [Zend_Db_Statement_Exception]
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '72-nb_visits' for key 'PRIMARY'






  [PDOException]
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '72-nb_visits' for key 'PRIMARY'



migration:measurable [--source-idsite="..."] [--target-db-host="..."] [--target-db-username="..."] [--target-db-password[="..."]] [--target-db-name="..."] [--target-db-prefix[="..."]] [--target-db-port="..."] [--skip-logs] [--skip-archives] [--dry-run] [--disable-db-transactions]

Is there anything we can do to ignore/skip/fix this?

Very high memory usage when migrating measurable

We had another user that had a similar experience as report in #38
However, in this case there was at least an error that was output:
ERROR [2022-08-01 11:12:19] 348340 Fatal error encountered: /var/www/matomo/libs/Zend/Db/Statement/Pdo.php(292): Allowed memory of 6442450944 bytes exhausted (tried to allocate 8192 bytes) [Query: , CLI mode: 1]

The user needed to increase the allowed memory to all available memory (AFAIK 16gb at least) in order for the migration to complete.
I asked the user to send us the size of the log_ tables, since it seems that there is an array created and held in memory for LogActionMigration which might be kept for the entire Migration.
But the size of the tables for this database are not very large, so the used memory seems to be quite excessive:

+--------------------+----------------------------------------------------+------------+
| Database | Table | Size in MB |
+--------------------+----------------------------------------------------+------------+
| MatomoDBName | log_link_visit_action | 1418.98 |
| MatomoDBName | log_visit | 1310.73 |
| MatomoDBName | log_action | 12.03 |
| MatomoDBName | log_media | 2.80 |
| MatomoDBName | log_media_plays | 0.08 |
| MatomoDBName | log_form | 0.05 |
| MatomoDBName | log_abtesting | 0.05 |
| MatomoDBName | log_hsr | 0.05 |
| MatomoDBName | log_hsr_event | 0.05 |
| MatomoDBName | log_conversion | 0.05 |
| MatomoDBName | log_hsr_blob | 0.03 |
| MatomoDBName | log_hsr_site | 0.03 |
| MatomoDBName | log_form_page | 0.03 |
| MatomoDBName | log_profiling | 0.03 |
| MatomoDBName | log_conversion_item | 0.03 |
| MatomoDBName | log_funnel | 0.03 |
| MatomoDBName | log_form_field | 0.02 |
+--------------------+----------------------------------------------------+------------+

No entry or class found for 'log.handlers

Hello,
when running the migration on the command line, I'm getting the following error. First I thought maybe the Pear-Log-Package was missing from the server, but I've checked with the hosting provider and it is present.

PHP Fatal error: Uncaught DI\NotFoundException: No entry or class found for 'log.handlers' in /www/htdocs/w01a420d/mela.geekgirls.de/wp-content/plugins/matomo/app/vendor/php-di/php-di/src/DI/Container.php:128 Stack trace: #0 /www/htdocs/w01a420d/mela.geekgirls.de/wp-content/plugins/matomo/app/core/Container/StaticContainer.php(80): DI\Container->get('log.handlers') #1 /www/htdocs/w01a420d/mela.geekgirls.de/wp-content/plugins/matomo/app/core/Console.php(71): Piwik\Container\StaticContainer::get('log.handlers')

I ran the command with and without the --skip-logs option.

Any ideas?

Regards,
Mela

migration gives warning Undefined array key 9434022

Hello,

I got the following warning during the migration.
WARNING [2023-11-28 10:49:56] 56 /var/www/html/plugins/Migration/Migrations/LogMigration.php(98): Warning - Undefined array key 9434022 - Matomo 4.14.2 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)

Only dif between the two is a difference that there was one plugin extra installed in the old matomo. It was the HeatMapSessionRecording plugin.

After completion I don't see the site in the new matomo instance.

Kind Regards,

Fatal Error Fatal error: Declaration of Symfony\Bridge\Monolog\Handler\ConsoleHandler::handle(array $record) must be compatible with Monolog

Hello,
I'm trying to export measurable from WordPress plugin to on-premise but have this Fatale error:

[26-Sep-2022 13:57:08 UTC] PHP Fatal error:  Declaration of Symfony\Bridge\Monolog\Handler\ConsoleHandler::handle(array $record) must be compatible with Monolog\Handler\AbstractProcessingHandler::handle(array $record): bool in /XXXX/wp-content/plugins/matomo/app/vendor/symfony/monolog-bridge/Symfony/Bridge/Monolog/Handler/ConsoleHandler.php on line 88
`
### wp-core ###

version: 6.0.2
site_language: fr_FR
user_language: en_US
timezone: Europe/Paris
permalink: /%postname%/
https_status: true
multisite: false
user_registration: 0
blog_public: 1
default_comment_status: closed
environment_type: production
user_count: 6
dotorg_communication: true

### wp-paths-sizes ###

wordpress_path: /home/fpfm2068/ndbm
wordpress_size: loading...
uploads_path: /home/fpfm2068/ndbm/wp-content/uploads
uploads_size: loading...
themes_path: /home/fpfm2068/ndbm/wp-content/themes
themes_size: loading...
plugins_path: /home/fpfm2068/ndbm/wp-content/plugins
plugins_size: loading...
database_size: loading...
total_size: loading...

### wp-dropins (2) ###

advanced-cache.php: true
object-cache.php: true

### wp-active-theme ###

name: ND Blancs Manteaux (nd-blancs-manteaux)
version: 1.0.0
author: Sébastien SERRE
author_website: http://thivinfo.com/
parent_theme: Accelerate (accelerate)
theme_features: core-block-patterns, widgets-block-editor, wp-block-styles, align-wide, custom-line-height, editor-style, responsive-embeds, custom-spacing, automatic-feed-links, post-thumbnails, title-tag, woocommerce, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider, menus, custom-background, post-formats, html5, custom-logo, customize-selective-refresh-widgets, custom-header, widgets
theme_path: /home/fpfm2068/ndbm/wp-content/themes/nd-blancs-manteaux
auto_update: Disabled

### wp-parent-theme ###

name: Accelerate (accelerate)
version: 1.5.0
author: ThemeGrill
author_website: https://themegrill.com
theme_path: /home/fpfm2068/ndbm/wp-content/themes/accelerate
auto_update: Disabled

### wp-mu-plugins (3) ###

MU Plugins Loader: version: 1.0.0, author: Sébastien SERRE
WP Umbrella: version: 1.0.0, author: WP Umbrella
_WPHealthHandlerMU.php: author: (undefined), version: (undefined)

### wp-plugins-active (27) ###

Advanced Editor Tools (previously TinyMCE Advanced): version: 5.6.0, author: Automattic, Auto-updates enabled
Complianz | GDPR/CCPA Cookie Consent: version: 6.3.3, author: Really Simple Plugins, Auto-updates enabled
Contact Form 7: version: 5.6.3, author: Takayuki Miyoshi, Auto-updates enabled
Date Time Picker for Contact Form 7: version: 1.1.0, author: Ruhul Amin, Auto-updates disabled
Easy WP SMTP: version: 1.4.7, author: wpecommerce, alexanderfoxc, Auto-updates disabled
Email Address Encoder: version: 1.0.22, author: Till Krüss, Auto-updates enabled
Events Manager: version: 6.1.2.1, author: Marcus Sykes, Auto-updates enabled
Flamingo: version: 2.3, author: Takayuki Miyoshi, Auto-updates enabled
hCaptcha for Forms and More: version: 1.19.0, author: hCaptcha, Auto-updates enabled
Honeypot for Contact Form 7: version: 2.1.1, author: Nocean, Auto-updates enabled
iThemes Security: version: 8.1.2, author: iThemes, Auto-updates enabled
Matomo Analytics - Ethical Stats. Powerful Insights.: version: 4.11.0, author: Matomo, Auto-updates enabled
Migration (Matomo Plugin): version: 4.0.2, author: Matomo, Auto-updates disabled
Newsletter, SMTP, Email marketing and Subscribe forms by Sendinblue: version: 3.1.50, author: Sendinblue, Auto-updates enabled
o2switch - WpTiger: author: (undefined), version: 28-02-22, Auto-updates disabled
OSM: version: 6.0, author: MiKa, Auto-updates enabled
Photo Gallery: version: 1.7.4, author: Photo Gallery Team, Auto-updates enabled
Really Simple CAPTCHA: version: 2.1, author: Takayuki Miyoshi, Auto-updates enabled
Redirection: version: 5.3.4, author: John Godley, Auto-updates enabled
Redis Object Cache: version: 2.2.0, author: Till Krüss, Auto-updates disabled
Regenerate Thumbnails: version: 3.1.5, author: Alex Mills (Viper007Bond), Auto-updates enabled
Responsive Lightbox & Gallery: version: 2.4.1, author: dFactory, Auto-updates enabled
SEOPress: version: 5.9.0.4, author: The SEO Guys at SEOPress, Auto-updates enabled
SEOPress PRO: version: 5.9.0.1, author: The SEO Guys at SEOPress, Auto-updates enabled
WP Crontrol: version: 1.14.0, author: John Blackbourn & crontributors, Auto-updates disabled
WP Rocket: version: 3.12.1, author: WP Media, Auto-updates disabled
WP Umbrella: version: 2.3.0, author: WP Umbrella - Backup & Manage WordPress, Auto-updates disabled

### wp-plugins-inactive (1) ###

Post SMTP: version: 2.1.9, author: Post SMTP, Auto-updates disabled

### wp-media ###

image_editor: WP_Image_Editor_GD
imagick_module_version: Not available
imagemagick_version: Not available
imagick_version: Not available
file_uploads: File uploads is turned off
post_max_size: 8M
upload_max_filesize: 2M
max_effective_size: 2 MB
max_file_uploads: 20
gd_version: 2.2.5
gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM
ghostscript_version: 9.25

### wp-server ###

server_architecture: Linux 4.18.0-348.7.1.lve.el7h.x86_64 x86_64
httpd_software: Apache
php_version: 8.0.23 64bit
php_sapi: litespeed
max_input_variables: 1000
time_limit: 30
memory_limit: 2048M
max_input_time: 60
upload_max_filesize: 2M
php_post_max_size: 8M
curl_version: 7.71.0 OpenSSL/1.1.1p
suhosin: false
imagick_availability: false
pretty_permalinks: true
htaccess_extra_rules: true

### wp-database ###

extension: mysqli
server_version: 10.5.17-MariaDB
client_version: mysqlnd 8.0.23
max_allowed_packet: 268435456
max_connections: 500

### wp-constants ###

WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /home/fpfm2068/ndbm/wp-content
WP_PLUGIN_DIR: /home/fpfm2068/ndbm/wp-content/plugins
WP_MEMORY_LIMIT: 40M
WP_MAX_MEMORY_LIMIT: 2048M
WP_DEBUG: true
WP_DEBUG_DISPLAY: false
WP_DEBUG_LOG: true
SCRIPT_DEBUG: false
WP_CACHE: true
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: Undefined
DB_CHARSET: utf8
DB_COLLATE: undefined

### wp-filesystem ###

wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
mu-plugins: writable

Migration InvalidArgumentException

Using Matomo 4.2.1 on both sides.
After calling
./console migration:measurable --source-idsite=19 --target-db-host=xxx --target-db-username=xxx --target-db-password=xxx --target-db-name=xxx --target-db-prefix=matomo_

it throws

  [InvalidArgumentException]
  There are no commands defined in the "migration" namespace.

Plugin is activated. What could be the problem?

Error on migration: Columns missing or Same version

Hello,

I'm trying to migrate data from a Matomo for WordPress instance to Matomo On-Premise. When running the command, I get this error:

The following columns are missing in the source DB table "wp_matomo_log_visit": custom_var_k6, custom_var_v6                                                                 
  [Exception]                                                     
  Please make sure both Matomo instances are on the same version

Do you know what the issue could be?
Thank you for your help,
François

Output error when server runs out of memory during migration

As mentioned in #37 we had a customer who's migration kept failing at a certain point.
They then increased the available memory from 12gb to 24gb and the migration was able to finish.

During this process they said that there were no errors in the logs our output from the migration plugin that indicated what the error was, so they were forced to try different things until something worked (Such as increasing available memory)

PHP Fatal error: Declaration of Symfony\Bridge\Monolog\Handler\ConsoleHandler::handle(array $record) must be compatible with Monolog\Handler\AbstractProcessingHandler::handle(array $record)

Migration-4.0.3

Command:
/opt/plesk/php/8.1/bin/php wp-content/plugins/matomo/app/console migration:measurable --source-idsite=1 --target-db-host='127.0.0.1' --target-db-username='user1' --target-db-password='password!' --target-db-name='matomo_example'

Tested with PHP 7.4 and 8.1

PHP Fatal error: Declaration of Symfony\Bridge\Monolog\Handler\ConsoleHandler::handle(array $record) must be compatible with Monolog\Handler\AbstractProcessingHandler::handle(array $record): bool in /var/www/vhosts/example.com/wp-content/plugins/matomo/app/vendor/symfony/monolog-bridge/Symfony/Bridge/Monolog/Handler/ConsoleHandler.php on line 88

columns are missing in the target DB table. Directly show suggestions on which alter table statements to run.

Using Matomo 3.14.0, added Migration plugin via web interface, started recommended console migration command set to insert data from active Matomo instance to a WordPress website with plugin https://wordpress.org/plugins/matomo/ v1.2.0 - command and result see below.
Before this, the WP plugin has been activated and tracking has been started.
The missing columns are not present in source database, too.
(Can I add missing columns and values manually?)

$ /opt/plesk/php/7.3/bin/php ./console migration:measurable --source-idsite="2" --target-db-host="localhost" --target-db-port="3306" --target-db-username="..." --target-db-password='...' --target-db-name="..." --target-db-prefix="wp_matomo_" --disable-db-transactions --dry-run
Dry run is enabled. No entries will be written on the target DB.
Are you sure you want to migrate the data for idSite 2. (y/N)y

The following columns are missing in the target DB table "wp_matomo_site": custom_css, custom_css_file
The following columns are missing in the target DB table "wp_matomo_log_visit": location_provider
The following columns are missing in the target DB table "wp_matomo_log_conversion": referer_visit_server_date
ERROR [2020-07-28 14:08:42] 5249  Uncaught exception: (...)/plugins/Migration/Commands/Migrate.php(84): Please make sure both Matomo instances are on the same version
Please make sure both Matomo instances are on the same version
#0 (...)/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Piwik\Plugins\Migration\Commands\Migrate->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 (...)/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 (...)/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(Piwik\Plugins\Migration\Commands\Migrate), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 [internal function]: Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 (...)/core/Console.php(140): call_user_func(Array, Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 (...)/core/Access.php(644): Piwik\Console->Piwik\{closure}()
#6 (...)/core/Console.php(141): Piwik\Access::doAsSuperUser(Object(Closure))
#7 (...)/core/Console.php(93): Piwik\Console->doRunImpl(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 (...)/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Piwik\Console->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 (...)/console(32): Symfony\Component\Console\Application->run()
#10 {main}


  [Exception]
  Please make sure both Matomo instances are on the same version

LogMigration.php(80): Undefined offset

I want to move the data of a siteid from my main instance to another Matomo instance where I can anonymize all data and use it as demo-data.

But when trying to migrate it always fails on single visits that throw the following exception:

➜  /var/www/matomo sudo -u www-data php7.3 console migration:measurable --source-idsite=2 --target-db-host="localhost" --target-db-username="user" --target-db-password="pass" --target-db-prefix="" --skip-archives  --target-db-name "glt_matomo"
Are you sure you want to migrate the data for idSite 2. (y/N)y
Processing SiteMigration at 2019-04-13 10:48:43
Target site is 17 at 2019-04-13 10:48:43
Processed SiteMigration at 2019-04-13 10:48:43
Processing SiteUrlMigration at 2019-04-13 10:48:43
Found 0 site urls at 2019-04-13 10:48:43
Processed SiteUrlMigration at 2019-04-13 10:48:43
Processing SiteSettingMigration at 2019-04-13 10:48:43
Found 5 site settings at 2019-04-13 10:48:43
Processed SiteSettingMigration at 2019-04-13 10:48:43
Processing GoalsMigration at 2019-04-13 10:48:43
Found 1 goals at 2019-04-13 10:48:43
Processed GoalsMigration at 2019-04-13 10:48:43
Processing SegmentsMigration at 2019-04-13 10:48:43
Found 0 segments at 2019-04-13 10:48:43
Processed SegmentsMigration at 2019-04-13 10:48:43
Processing AnnotationsMigration at 2019-04-13 10:48:43
Found annotations at 2019-04-13 10:48:43
Processed AnnotationsMigration at 2019-04-13 10:48:43
Processing CustomDimensionMigration at 2019-04-13 10:48:43
Found 0 custom dimensions at 2019-04-13 10:48:43
Processed CustomDimensionMigration at 2019-04-13 10:48:43
Processing LogMigration at 2019-04-13 10:48:43
Found 9273 visits at 2019-04-13 10:48:43
WARNING [2019-04-13 10:48:50] 21335  /var/www/matomo/plugins/Migration/Migrations/LogMigration.php(80): Notice - Undefined offset: 30547 - Matomo 3.9.1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)


                                                                                         
  [Zend_Db_Statement_Exception]                                                          
  SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'idvisit' cannot be null  

I guess there is something broken with these visits, but I think it shouldn't crash the migration, but rather skip the visit.


By stupidly trying to workaround this, I somehow got my mariadb so currupted that it didn't even start in any way anymore. So I just spend the last hour to restore the latest backup. (thankfully from last night)

No campaign data on wordpress with the latest plugin release

Campaign requests are empty

When requesting %wordpress_url%?mtm_campaign=2022_grundrauschen_dresden&mtm_placement=google#/Verf%C3%BCgbarkeitspr%C3%BCfung, If I enable the campaign plugin and create a segment with campaign name = 2022_grundrauschen_dresden and campaign placement = google, I don't have any result.

Expected behaviour

See my visit in the visitor log after apply this segment.

step to reproduce

  • install WordPress
  • install the Matomo marketplace plugin
  • go to the URL wp-admin/admin.php?page=matomo-marketplace
  • click on the download button under the Marketing Campaigns Reporting widget
  • Move the content of the extracted folder into your WordPress wp-content/plugins directory
  • Go to wp-admin/plugins.php
  • Click on the activate link under "Marketing Campaigns Reporting (Matomo Plugin)"
  • Go to your frontend website
  • request the URL ?mtm_campaign=2022_grundrauschen_dresden&mtm_placement=google#/Verf%C3%BCgbarkeitspr%C3%BCfung
  • Go to your Matomo when requesting /wp-content/plugins/matomo/app/index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday#?period=day&date=2022-09-28&idSite=1&category=General_Visitors&subcategory=Live_VisitorLog
  • Check that the last visit (please update the date in the date picker) contains only campaign placement value
  • Create a segment with campaign name = 2022_grundrauschen_dresden and campaign placement = google.
    Screenshot from 2022-09-28 13-52-07
  • Apply this segment
  • Go to wp-content/plugins/matomo/app/index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday#?period=day&date=2022-09-28&segment=campaignName%3D%3D2022_grundrauschen_dresden;campaignPlacement%3D%3Dgoogle&idSite=1&category=General_Visitors&subcategory=Live_VisitorLog for the current date and check there is no record in the visitor log.
  • Connect to your mysql database using the following command mysql -u %mysql_username% -p %mysql_database_name%
  • Run this SQL query: select * from wp_matomo_log_visit where campaign_name = '2022_grundrauschen_dresden' or campaign_placement = 'google'. Remplace wp_ in the table name by your wordpress prefix available in the wp-config.php file.
  • Consider there are no record having both a campaign name and a campaign placement.

Context

WordPress Version | 6.0.2
Matomo Plugin Version | 4.11.0
Matomo Install Version | 4.6.0
Marketing Campaigns Reporting (Matomo Plugin) | 4.1.3
Firefox version | 104.0 (64-bit)

Full diagnostics report

` # Matomo

  • Matomo Plugin Version: 4.11.0
  • Config exists and is writable.: Yes ("$abs_path/wp-content/uploads/matomo/config/config.ini.php" )
  • JS Tracker exists and is writable.: Yes ("$abs_path/wp-content/uploads/matomo/matomo.js" )
  • Plugin directories: Yes ([{"pluginsPathAbsolute":"$abs_path/wp-content/plugins/matomo/plugins","webrootDirRelativeToMatomo":"../"},{"pluginsPathAbsolute":"$abs_path/wp-content/plugins","webrootDirRelativeToMatomo":"../../"}])
  • Tmp directory writable: Yes ($abs_path/wp-content/cache/matomo)
  • Matomo Version: 4.11.0
  • Matomo Blog idSite: 1
  • Matomo Install Version: 4.6.0 (Install date: 2022-04-20 10:19:01)
  • Upgrades outstanding: No
  • Upgrade in progress: No

Endpoints

  • Matomo JavaScript Tracker URL: ($site_url/wp-content/uploads/matomo/matomo.js)
  • Matomo JavaScript Tracker - WP Rest API: ($site_url/wp-json/matomo/v1/hit/)
  • Matomo HTTP Tracking API: ($site_url/wp-content/plugins/matomo/app/matomo.php)
  • Matomo HTTP Tracking API - WP Rest API: ($site_url/wp-json/matomo/v1/hit/)

Crons

  • Server time: 2022-09-28 00:50:25
  • Blog time: 2022-09-28 00:50:25 (Below dates are shown in blog timezone)
  • Sync users & sites: Next run: 2022-09-28 10:21:10 (9 hours 30 min) ( Last started: 2022-09-27 19:12:44 (-5 hours 37 min). Last ended: 2022-09-27 19:12:44 (-5 hours 37 min). Interval: daily)
  • Archive: Next run: 2022-09-28 01:19:05 (28 min 40s) ( Last started: 2022-09-28 00:28:56 (-21 min 29s). Last ended: 2022-09-28 00:28:57 (-21 min 28s). Interval: hourly)
  • Update GeoIP DB: Next run: 2022-10-17 10:21:10 (19 days 9 hours) ( Last started: 2022-09-18 21:11:20 (-9 days 3 hours). Last ended: 2022-09-18 21:11:25 (-9 days 3 hours). Interval: matomo_monthly)

Mandatory checks

  • PHP version >= 7.2.5: ok
  • PDO extension: ok
  • PDO\MYSQL extension: ok
  • MYSQLI extension: ok
  • Other required extensions: ok
  • Required functions: ok
  • Required PHP configuration (php.ini): ok
  • Directories with write access: ok
  • Directories with write access for Tag Manager: ok

Optional checks

  • 64-bit PHP Binary: ok
  • Tracker status: ok
  • Memory limit: ok
  • Time zone: ok
  • Open URL: ok
  • PageSpeed is turned off: ok
  • GD > 2.x + FreeType (graphics): ok
  • Other extensions: ok
  • Other functions: ok
  • Filesystem: ok
  • Last Successful Archiving Completion: ok
  • Database abilities: ok
  • Max Packet Size: ok
  • Geolocation: ok
  • Update over HTTPS: ok
  • Warning Heatmap & Session Recording Tracking: warning (Requesting '$site_url/wp-content/plugins/matomo/app/../../HeatmapSessionRecording/configs.php?idsite=1&trackerid=5lX6EM&url=http%3A%2F%2Ftest.test%2F' resulted in an SSL error. Maybe you are using a self signed certificate? Please open the URL manually in a browser to see if the response contains 'Piwik.HeatmapSessionRecording'. If not, you might need to modify your server configuration as this file needs to be accessible via a browser from the Internet or Intranet. )
  • Supports Async Archiving: No
  • Location provider ID: geoip2php
  • Location provider available: Yes
  • Location provider working: Yes
  • Had visit in last 5 days: Yes
  • Matomo URL: Yes ($site_url/wp-content/plugins/matomo/app/)

Matomo Settings

  • Track mode: default
  • Track codeposition: footer
  • Track api endpoint: default
  • Track js endpoint: default
  • Version history: 4.11.0, 4.10.0, 4.9.0, 4.6.0
  • Core version: 4.11.0
  • Last tracking settings update: 1650450019
  • Last settings update: 1660778286
  • Mail history: 2022-09-26 19:04:47, 2022-09-21 20:41:02, 2022-09-14 00:51:53
  • Delete all data uninstall: No

Logs

  • mail_error: 2022-09-21 20:41:02 (Could not instantiate mail function. (has attachments) (type text/html) => Email.php:159; Email.php:69; Mail.php:292; ScheduledReports.php:435; EventDispatcher.php:141; Piwik.php:845; API.php:707; Context.php:75; API.php:719; Scheduler.php:309; Scheduler.php:154; API.php:68; CronArchive.php:653; CronArchive.php:279; Access.php:670; CronArchive.php:284; ScheduledTasks.php:332; class-wp-hook.php:305; class-wp-hook.php:331; plugin.php:524; wp-cron.php:138;)
  • mail_error: 2022-09-26 19:04:47 (Could not instantiate mail function. (has attachments) (type text/html) => Email.php:159; Email.php:69; Mail.php:292; ScheduledReports.php:435; EventDispatcher.php:141; Piwik.php:845; API.php:707; Context.php:75; API.php:719; Scheduler.php:309; Scheduler.php:154; API.php:68; CronArchive.php:653; CronArchive.php:279; Access.php:670; CronArchive.php:284; ScheduledTasks.php:332; class-wp-hook.php:305; class-wp-hook.php:331; plugin.php:524; wp-cron.php:138;)
  • ajax_tracker: 2022-09-26 19:05:43 (cURL error 60: SSL: no alternative certificate subject name matches target host name '$DB_USER.local' => AjaxTracker.php:91; MatomoTracker.php:793; Base.php:103; Woocommerce.php:176; Woocommerce.php:103; class-wp-hook.php:305; class-wp-hook.php:331; plugin.php:476; class-wc-cart.php:1276; class-wc-ajax.php:434; class-wp-hook.php:307; class-wp-hook.php:331; plugin.php:476; class-wc-ajax.php:93; class-wp-hook.php:307; class-wp-hook.php:331; plugin.php:476; template-loader.php:13; wp-blog-header.php:19; index.php:17;)

WordPress

  • Home URL: $site_url
  • Site URL: $site_url
  • WordPress Version: 6.0.2
  • Number of blogs: 1
  • Multisite Enabled: No
  • Network Enabled: No
  • WP_DEBUG: Yes
  • WP_DEBUG_DISPLAY: Yes
  • WP_DEBUG_LOG: /tmp/wp.log
  • DISABLE_WP_CRON: -
  • FORCE_SSL_ADMIN: Yes
  • WP_CACHE: Yes
  • CONCATENATE_SCRIPTS: -
  • COMPRESS_SCRIPTS: -
  • COMPRESS_CSS: -
  • ENFORCE_GZIP: -
  • WP_LOCAL_DEV: -
  • WP_CONTENT_URL: $site_url/wp-content
  • WP_CONTENT_DIR: $abs_path/wp-content
  • UPLOADS: -
  • BLOGUPLOADDIR: -
  • DIEONDBERROR: -
  • WPLANG: -
  • ALTERNATE_WP_CRON: -
  • WP_CRON_LOCK_TIMEOUT: 60
  • WP_DISABLE_FATAL_ERROR_HANDLER: -
  • MATOMO_SUPPORT_ASYNC_ARCHIVING: No
  • MATOMO_TRIGGER_BROWSER_ARCHIVING: -
  • MATOMO_ENABLE_TAG_MANAGER: -
  • MATOMO_SUPPRESS_DB_ERRORS: -
  • MATOMO_ENABLE_AUTO_UPGRADE: -
  • MATOMO_DEBUG: -
  • MATOMO_SAFE_MODE: -
  • MATOMO_GLOBAL_UPLOAD_DIR: -
  • MATOMO_LOGIN_REDIRECT: -
  • Permalink Structure: /%year%/%monthnum%/%postname%/
  • Possibly uses symlink: No
  • Upload base url: $site_url/wp-content/uploads
  • Upload base dir: $abs_path/wp-content/uploads
  • Upload url: $site_url/wp-content/uploads/2022/09
  • Custom upload_path:
  • Custom upload_url_path:
  • Compatible content directory: Yes

WordPress Plugins

  • Admin Notification (Matomo Plugin): 4.0.0
  • Custom Reports (Matomo Plugin): 4.0.15
  • Funnels (Matomo Plugin): 4.0.7
  • Heatmap & Session Recording for Matomo: 4.5.0
  • Marketing Campaigns Reporting (Matomo Plugin): 4.1.3
  • Matomo Analytics - Ethical Stats. Powerful Insights.: 4.11.0
  • Matomo Marketplace for WordPress: 1.0.10
  • Query Monitor: 3.10.1
  • Search Engine Keywords Performance (Matomo Plugin): 4.3.3
  • WooCommerce: 6.9.4
  • WP Rocket: 3.12.1
  • Active Plugins: 11 (query-monitor AdminNotification CustomReports Funnels HeatmapSessionRecording MarketingCampaignsReporting SearchEngineKeywordsPerformance matomo-marketplace-for-$DB_USER matomo woocommerce wp-rocket)
  • Warning Not compatible plugins: 1 (wp-rocket Matomo may work fine when using these plugins but there may be some issues. For more information see https://matomo.org/faq/$DB_USER/which-plugins-is-matomo-for-$DB_USER-known-to-be-not-compatible-with/ WP-Rocket is incompatible from version 3.12. Until fixes, please reinstall version 3.11.5 if you have a newer version. For more information please visit https://github.com/matomo-org/matomo-for-$DB_USER/wiki/Downgrade-wp-rocket-to-a-version-compatible-with-the-Matomo-plugin)
  • Theme: twentytwentytwo (twentytwentytwo)

Server

  • Server Info: Apache/2.4.41 (Ubuntu)
  • PHP OS: Linux
  • PHP Version: 8.0.22
  • PHP SAPI: apache2handler
  • PHP Error Reporting: 4437 After bootstrap: 4437
  • PHP Found Binary: php -q
  • Timezone: UTC
  • WP timezone: +00:00
  • Locale: en_US
  • User Locale: en_US
  • Memory Limit: 512M (At least 128MB recommended. Depending on your traffic 256MB or more may be needed.)
  • WP Memory Limit: 40M
  • WP Max Memory Limit: 512M
  • Timezone version: 0.system
  • Time: 1664326225
  • Max Execution Time: 600
  • Max Post Size: 8M
  • Max Upload Size: 2097152
  • Max Input Vars: 1000
  • Disabled PHP functions: Yes (pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,)
  • zlib.output_compression is off: Yes
  • Curl Version: 7.68.0, OpenSSL/1.1.1f
  • Suhosin installed: No

Database

  • MySQL Version: 8.0.30
  • Mysqli Connect: Yes
  • Force MySQL over Mysqli: No
  • DB Prefix: wp_
  • DB CHARSET: utf8mb4
  • DB COLLATE:
  • SHOW ERRORS: No
  • SUPPRESS ERRORS: No
  • Uses Socket: No
  • Uses IPv6: No
  • Matomo tables found: 133
  • DB tables exist: Yes
  • Matomo users found: 1
  • Matomo sites found: 1
  • Required permissions: OK

Browser

  • Browser: (Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0)
  • Language: en-gb,en

`

Let me know if you need additional detail.

Command "migration" is not defined.

Hi, trying to move one site over to another Matomo server.
I run the command
./console migration --source-idsite=1 --target-db-host=newserver --target-db-username=mySQLusername --target-db-password=secure --target-db-name=databaseName
I receive this error
[InvalidArgumentException] Command "migration" is not defined.

WP DB Error: [1146] Table 'DBNAME.site' doesn't exist SQL: SHOW COLUMNS FROM site

I want to migrate from Matomo instance for WordPress to my own Matomo installation. The following error occurs:

php71-cli wp-content/plugins/matomo/app/console migration:measurable --source-idsite=1 --target-db-host=HOST --target-db-username=USERNAME --target-db-password=PASSWORD --target-db-name=DBNAME
Are you sure you want to migrate the data for idSite 1. (y/N)y
Matomo: Uncaught exception: /wp-content/plugins/matomo/classes/WpMatomo/Db/WordPress.php(404): WP DB Error: [1146] Table 'DBNAME.site' doesn't exist SQL: SHOW COLUMNS FROM site
WP DB Error: [1146] Table 'DBNAME.site' doesn't exist SQL: SHOW COLUMNS FROM site
#0 /wp-content/plugins/matomo/classes/WpMatomo/Db/WordPress.php(416): Piwik\Db\Adapter\WordPress->after_execute_query(Object(wpdb), 'SHOW COLUMNS FR...')
#1 /wp-content/plugins/Migration/TargetDb.php(88): Piwik\Db\Adapter\WordPress->fetchAll('SHOW COLUMNS FR...')
#2 /wp-content/plugins/Migration/Migrations/BaseMigration.php(56): Piwik\Plugins\Migration\TargetDb->getTableColumns('site')
#3 /wp-content/plugins/Migration/Migrations/SiteMigration.php(21): Piwik\Plugins\Migration\Migrations\BaseMigration->checkTablesHaveSameStructure(Object(Piwik\Plugins\Migration\TargetDb), 'site')
#4 /wp-content/plugins/Migration/Commands/Migrate.php(76): Piwik\Plugins\Migration\Migrations\SiteMigration->validateStructure(Object(Piwik\Plugins\Migration\TargetDb))
#5 /wp-content/plugins/matomo/app/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Piwik\Plugins\Migration\Commands\Migrate->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /wp-content/plugins/matomo/app/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /wp-content/plugins/matomo/app/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(Piwik\Plugins\Migration\Commands\Migrate), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 [internal function]: Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /wp-content/plugins/matomo/app/core/Console.php(140): call_user_func(Array, Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /wp-content/plugins/matomo/app/core/Access.php(644): Piwik\Console->Piwik\{closure}()
#11 /wp-content/plugins/matomo/app/core/Console.php(141): Piwik\Access::doAsSuperUser(Object(Closure))
#12 /wp-content/plugins/matomo/app/core/Console.php(93): Piwik\Console->doRunImpl(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /wp-content/plugins/matomo/app/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Piwik\Console->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /wp-content/plugins/matomo/app/console(32): Symfony\Component\Console\Application->run()
#15 {main}

[Zend_Db_Statement_Exception]
WP DB Error: [1146] Table 'DBNAME.site' doesn't exist SQL: SHOW COLUMNS FROM site

I see the problem in tablenames. It should be "DBNAME.WordPress-prefix_matomo_site" (there is such table in DB), but there is just: DBNAME.site.

I wonder if you could help me with this strange bug(?).

Integrity constraint violation: 1062 Duplicate entry '1-bounce_count' for key 'PRIMARY' in archive Table

Hello and thanks for implementing the migration tool.

unfortunately we have problems with the Archive Tabales during the migration of an old Matomo installation to another Matomo installation
source Side ID is 1

If we work with --skip-archives the migration is running.

Maybe there is the same problem as #7

Starting to migrate archive table stat_archive_numeric_2010_01 at 2020-10-12 09:22:00
ERROR [2020-10-12 09:22:00] 20957  Uncaught exception: /var/www/xxx/libs/Zend/Db/Statement/Pdo.php(234): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-bounce_count' for key 'PRIMARY'
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-bounce_count' for key 'PRIMARY'
#0 /var/www/xxx/libs/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute()
#1 /var/www/xxx/core/Db/Adapter/Pdo/Mysql.php(305): Zend_Db_Statement->execute()
#2 /var/www/xxx/plugins/Migration/TargetDb.php(162): Piwik\Db\Adapter\Pdo\Mysql->query()
#3 /var/www/xxx/plugins/Migration/Migrations/ArchiveMigration.php(56): Piwik\Plugins\Migration\TargetDb->insert()
#4 /var/www/xxx/plugins/Migration/Migrations.php(40): Piwik\Plugins\Migration\Migrations\ArchiveMigration->migrate()
#5 /var/www/xxx/plugins/Migration/Commands/Migrate.php(95): Piwik\Plugins\Migration\Migrations->migrate()
#6 /var/www/xxx/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Piwik\Plugins\Migration\Commands\Migrate->execute()
#7 /var/www/xxx/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run()
#8 /var/www/xxx/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand()
#9 [internal function]: Symfony\Component\Console\Application->doRun()
#10 /var/www/xxx/core/Console.php(140): call_user_func()
#11 /var/www/xxx/core/Access.php(644): Piwik\Console->Piwik\{closure}()
#12 /var/www/xxx/core/Console.php(141): Piwik\Access::doAsSuperUser()
#13 /var/www/xxx/core/Console.php(93): Piwik\Console->doRunImpl()
#14 /var/www/xxx/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Piwik\Console->doRun()
#15 /var/www/xxx/console(32): Symfony\Component\Console\Application->run()
#16 {main},
caused by: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-bounce_count' for key 'PRIMARY'
#0 /var/www/xxx/libs/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute()
#1 /var/www/xxx/libs/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute()
#2 /var/www/xxx/core/Db/Adapter/Pdo/Mysql.php(305): Zend_Db_Statement->execute()
#3 /var/www/xxx/plugins/Migration/TargetDb.php(162): Piwik\Db\Adapter\Pdo\Mysql->query()
#4 /var/www/xxx/plugins/Migration/Migrations/ArchiveMigration.php(56): Piwik\Plugins\Migration\TargetDb->insert()
#5 /var/www/xxx/plugins/Migration/Migrations.php(40): Piwik\Plugins\Migration\Migrations\ArchiveMigration->migrate()
#6 /var/www/xxx/plugins/Migration/Commands/Migrate.php(95): Piwik\Plugins\Migration\Migrations->migrate()
#7 /var/www/xxx/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Piwik\Plugins\Migration\Commands\Migrate->execute()
#8 /var/www/xxx/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run()
#9 /var/www/xxx/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand()
#10 [internal function]: Symfony\Component\Console\Application->doRun()
#11 /var/www/xxx/core/Console.php(140): call_user_func()
#12 /var/www/xxx/core/Access.php(644): Piwik\Console->Piwik\{closure}()
#13 /var/www/xxx/core/Console.php(141): Piwik\Access::doAsSuperUser()
#14 /var/www/xxx/core/Console.php(93): Piwik\Console->doRunImpl()
#15 /var/www/xxx/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Piwik\Console->doRun()
#16 /var/www/xxx/console(32): Symfony\Component\Console\Application->run()
#17 {main}
                                                                                                            
  [Zend_Db_Statement_Exception]                                                                             
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-bounce_count' for key 'PRIMARY'  
                                                                                                            

                                                                                                           
  [PDOException]                                                                                            
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-bounce_count' for key 'PRIMARY'  

if we delete the old entry in the target database it will continue but it will hang at the next position. Probably the ID is not replaced before the insert is executed ?


  [Zend_Db_Statement_Exception]                                                                             
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-bounce_count' for key 'PRIMARY'

Does anyone have an idea how to migrate to the other Matomo instance?

Thanks
greetings
mor

Add more details to SSH tunnel example

The README has this part about SSH tunneling:

Both Matomo instances may be on different servers with proper firewall rules that restrict database access on target instance. In such case, the easiest way for source server to access target database is to create a ssh tunnel on new port (e.g. 3307) in another terminal. Then, execute to the above command with --target-db-port=3307 instead to access port 3306 on target host. Example:

ssh -NL 3307:localhost:3306 targetuser@targethost

It would be great with more details, like where is the command supposed to be run? Also, what is the value of targetuser@targethost supposed to be set to?

Thanks!!

Migration and site IDs

When installing the Matomo plugin for WordPress, a record is being created for the site in wp_matomo_site table with idsite=1.
Using Migration plugin in Matomo 3.14.0, the data from a site with id 2 is being imported into the WordPress datababase, but a second site in the target database with idsite=2 is being created and all data is referring to that ID 2.
The Matomo plugin for WordPress seems to expect a site with ID 1 and we can switch to site ID 2 in the Dashboard, but this is not nice to do this every time. And the plugin seems no to be able to handle only 1 site in wp_matomo_site table with any other ID than 1 (it leads to a fatal error).
So it seems to be necessary to provide a target-site-id paramater for the console migration command.
And I like to know whether I can change the cross linking reference from the default site to the data in the WordPress database to prevent the user from changing the site in the Dashboary every time.

Missing columns in the source DB table

I am trying to migrate from Matomo for WordPress (4.15.0) to Matomo On-Premise (v4.15.1), but receive the following error message:

The following columns are missing in the source DB table "xyz_matomo_log_conversion": pageviews_before

[Exception]
Please make sure both Matomo instances are on the same version and have the same plugins and plugin versions installed.

How should I deal best with it? Should I remove the column from the target database, or should I add it (how exactly) to the source database?

Thanks a lot for your help!

wp migration [Zend_Db_Adapter_Mysqli_Exception] Access denied for user ''@'localhost' (using password: NO)

I'm not sure what I miss, or if It is a bug, when I try to migrate the data from the wordpress matomo plugin "Matomo Analytics" to a new "On-Promise" installation.

  1. install the matomo marketplace plugin on the wordpress installation
  2. install the matomo migration plugin form the matomo marketplace (btw. where can I see the Version?)
  3. login to webserver via ssh to wp installation directory (where you can see wp-content etc.)
  4. run php wp-content/plugins/matomo/app/console migration:measurable --dry-run --source-idsite=1 --target-db-prefix=wp_matomo_ --target-db-host=NEW_DB_HOST --target-db-username=NEW_DB_USER --target-db-password=NEW_DB_PWD --target-db-name=NEW_DB_NAME (with or without prefix, same result)

Unfortunately I got a following error [Zend_Db_Adapter_Mysqli_Exception] Access denied for user ''@'localhost' (using password: NO)

The NEW_DB_USER is set to a valid name, which is not ''@'localhost' or similar
The NEW_DB_HOST is set to the host, which I see in phpMyAdmin for User: NEW_DB_USER@NEW_DB_HOST
The NEW_DB_PWD is set to the the matching pwd for NEW_DB_USER

If I miss something, could you update or describe the migration process in more detail?

Thank you very much.

[InvalidArgumentException]

Hello,
when I start the command
./console migration:measurable --dry-run --source-idsite=1 --target-db-host=x.x.x.x --target-db-username=root --target-db-password=xxxxxx --target-db-name=stats-TEST

I get the error:
Uncaught exception: /home/xxxxx/htdocs/stats/vendor/symfony/console/Symfony/Component/Console/Application.php(501): There are no commands defined in the "migration" namespace.
There are no commands defined in the "migration" namespace.

I use Matomo 3.13.3 on both sides.

Any ideas?

Syntax error for option table when migrating

When performing a migration the following error occurs:

  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option (`option_name`,`option_value`,`autoload`) VALUES('2_annotations','a:1:{i:' at l

This error doesn't show up when performing a dry run and was encountered when migrating between two identical instances on Cloud

This is the command used to start the migration:

sudo -u apache -E bash -c "time php -d memory_limit=11G /var/www/html/console migration:measurable  --source-idsite=3 --target-db-host=${host} --target-db-username=${username} --target-db-name=${dbname} --target-db-password=${password} --matomo-domain=SUBDOMAIN.matomo.cloud"

tables are missing in the target DB table

I think here it should say "The following columns are missing in the target DB table".

$errors[] = sprintf('The following tables are missing in the target DB table "%s": %s', $targetTable, implode(', ', $diff));
} else {
$diff = array_diff($targetColumnNames, $columnNames);
if (!empty($diff)) {
$errors[] = sprintf('The following tables are missing in the source DB table "%s": %s', $sourceTable, implode(', ', $diff));
}

Graphs/overviews incomplete after migration

Hi,

I currently was migrating a Site and realized, there is data missing in the graphs/overviews.

Here two screenshots from the old instance and the new instance. In the bottom left, you can see, there is data for the last 24 hours, but all the graphs and overviews show 0. Do you have any idea how to solve this? Is this caused by the Migration plugin? Or do I need to execute any CLI task to generate/correct the graphs?

data in old instance data in new instance
Bildschirmfoto 2020-05-04 um 13 02 00 Bildschirmfoto 2020-05-04 um 13 01 47

Support Migration from On-Premise to Matomo for WordPress

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

Migrate only a specified time period?

Is it possible, to restrict migration to a certain time period? This would be useful, if for example visits have been counted erranously on a different server. (This happened to a customer of mine due to a misconfiguration of his reverse proxy server.)

Support custom alerts

These are stored in two tables where one alert can be mapped to multiple sites, need some extra logic for that.

Improve documentation for requirements (Server specs, etc.)

We had a user who migrated a site with approx. 1.3M visits that encountered issues while migrating from one database to another.

The process kept failing at a certain point in the process and only after they doubled the available memory from 12GB to 24GB was the migration able to complete.

It would be good if we could document some basic requirements, perhaps even just estimates based on number visits or database size?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.