Missing column name after migrating from 1.12 to 4.0

I previously tested out a migration from a super old version of Piwik (1.12) to Matomo 3.14.1, and then to 4.0.0. There was at least one manual intervention that I had to make to get things working.

I figured that it would be safe to migrate all the way from 1.12 to 4.0 as part of the live migration from an old server to a new one. However, I’m getting this error on the Matomo dashboard after the migration:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'log_link_visit_action.pageview_position' in 'field list'

I noticed that the old column name interaction_position (according to 4.0.0-b1.php) is not in the table definition either.

I would appreciate any help… I’m looking through code and other related issues people have had in the past, but so far I’ve had no luck. Thanks! : )

1 Like

I noticed that the migration code included the attributes of the column, so I fixed the issue by running this command:

alter table matomo_log_link_visit_action add pageview_position MEDIUMINT UNSIGNED DEFAULT NULL;

It looks like new connections are recording actions, so hopefully that’s good enough.

Any input on this would be appreciated. I’m worried that there is code outside of core/Updates that is intended to modify tables, and which I am missing via this approach.

Thanks! : )

1 Like

Hi,

Could it be possible that the update needed to do a huge amount of database migrations (as you skipped many years of updates) and it ran into an timeout?
Did you run it from the commandline or the browser?

I ran it from the command line. After running all of the migrations, it said that there was an issue with the “CustomDimensions” plugin migration (missing table), so I disabled the extension. Running the migrations again via the cli lead to message saying that they were already complete. So the migrations didn’t time out.

I should note that I ran into a similar issue when upgrading from 1.12 to 3.14.1 / 4.0.0. I had to copy an empty matomo_segment table from a fresh install into the live database.

I also noticed that the option to upgrade to utf8mb4 in my database was missing from the available commands in console. I’m not sure if that was performed automatically by the migration script.

My main concern is whether there are migrations that are performed by the running site, ie code outside of core/Upgrades.

Thanks for your help. : )

Thank you Andrew E for documenting your table fix. The version we upgraded from was still called piwik, so I needed to modify alter table piwik_log_link_visit_action add pageview_position MEDIUMINT UNSIGNED DEFAULT NULL; to get past the SQL Column not found error.