Matomo database will be upgraded from version 4.15.1 to the new version 5.1.1.
The following dimensions will be updated: log_conversion.pageviews_before.
Important notes for large Matomo installations
If you have a large Matomo database, updates might take too long to run in the browser. In this situation, you can execute the updates from your command line:
php /var/www/matomo/console core:update
If you manage a high traffic Matomo server, we recommend to momentarily disable visitor Tracking and put the Matomo User Interface in maintenance mode.
FYI: these are the SQL queries and console commands that will be executed to upgrade your database to Matomo 5.1.1
› Click here to view and copy the list of SQL queries and console commands that will get executed
# These SQL queries will be executed:
DELETE FROM `matomo_archive_numeric_2022_01` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2022_01` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2022_01` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2022_02` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2022_02` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2022_02` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2022_03` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2022_03` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2022_03` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2022_04` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2022_04` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2022_04` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2022_05` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2022_05` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2022_05` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2022_06` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2022_06` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2022_06` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2022_07` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2022_07` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2022_07` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2022_08` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2022_08` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2022_08` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2022_09` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2022_09` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2022_09` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2022_10` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2022_10` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2022_10` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2022_11` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2022_11` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2022_11` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2022_12` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2022_12` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2022_12` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2023_01` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2023_01` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2023_01` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2023_02` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2023_02` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2023_02` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2023_03` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2023_03` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2023_03` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2023_04` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2023_04` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2023_04` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2023_05` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2023_05` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2023_05` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2023_06` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2023_06` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2023_06` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2023_07` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2023_07` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2023_07` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2023_08` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2023_08` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2023_08` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2023_09` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2023_09` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2023_09` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2023_10` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2023_10` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2023_10` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2023_11` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2023_11` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2023_11` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2023_12` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2023_12` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2023_12` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2024_01` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2024_01` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2024_01` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2024_02` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2024_02` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2024_02` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2024_03` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2024_03` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2024_03` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2024_04` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2024_04` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2024_04` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2024_05` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2024_05` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2024_05` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2024_06` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2024_06` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2024_06` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2024_07` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2024_07` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2024_07` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2024_08` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2024_08` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2024_08` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2024_09` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2024_09` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2024_09` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2024_10` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2024_10` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2024_10` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2024_11` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2024_11` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2024_11` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2024_12` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2024_12` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2024_12` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
DELETE FROM `matomo_archive_numeric_2025_01` WHERE ts_archived is null;
ALTER TABLE `matomo_archive_numeric_2025_01` DROP INDEX `index_idsite_dates_period`;
ALTER TABLE `matomo_archive_numeric_2025_01` ADD INDEX index_idsite_dates_period (`idsite`, `date1`, `date2`, `period`, `name` (6));
ALTER TABLE `matomo_user_token_auth` ADD COLUMN `post_only` TINYINT(2) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `matomo_log_conversion` ADD COLUMN `pageviews_before` SMALLINT UNSIGNED DEFAULT NULL;
# These console commands will be run:
./console core:calculate-conversion-pages --dates=yesterday,today
# These SQL queries will be executed:
ALTER TABLE `matomo_log_visit` RENAME INDEX `index_idsite_idvisitor` TO `index_idsite_idvisitor_time`;
ALTER TABLE `matomo_log_visit` ADD INDEX `index_idsite_idvisitor_time` (`idsite`, `idvisitor`, `visit_last_action_time` DESC);
ALTER TABLE `matomo_log_visit` DROP INDEX `index_idsite_idvisitor`;
# These console commands will be run:
./console plugin:activate "JsTrackerInstallCheck"
# These SQL queries will be executed:
ALTER TABLE `matomo_user_token_auth` CHANGE `post_only` `secure_only` TINYINT(2) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `matomo_user` ADD COLUMN `ts_changes_shown` TIMESTAMP NULL;
ALTER TABLE `matomo_log_conversion` ADD COLUMN `pageviews_before` SMALLINT UNSIGNED DEFAULT NULL;
Need help upgrading Matomo?
If you need support to upgrade your Matomo, the creators of Matomo are here to help you make the Matomo upgrade a success and provide all instructions, best practises and ongoing support. Contact the Matomo experts to get started upgrading your Matomo safely.
Ready to go?
The database upgrade process may take a while, so please be patient.