Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on migration: Columns missing or Same version #16

Open
fr-olivier opened this issue Mar 3, 2020 · 4 comments
Open

Error on migration: Columns missing or Same version #16

fr-olivier opened this issue Mar 3, 2020 · 4 comments

Comments

@fr-olivier
Copy link

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

@tsteur
Copy link
Member

tsteur commented Mar 3, 2020

This is because the Matomo for WordPress plugin does not have the plugin CustomVariables enabled.

You would basically need to add these columns manually to your WordPress installation like

ALTER TABLE wp_matomo_log_visit ADD COLUMN custom_var_k1 VARCHAR(200) NULL DEFAULT NULL;
ALTER TABLE wp_matomo_log_visit ADD COLUMN custom_var_v1 VARCHAR(200) NULL DEFAULT NULL;

Same would probably need to be done for custom_var_v1 to custom_var_v5.

Then similar likely also for the other tables

ALTER TABLE wp_matomo_log_visit ADD COLUMN custom_var_k1 VARCHAR(200) NULL DEFAULT NULL;
ALTER TABLE wp_matomo_log_visit ADD COLUMN custom_var_v1 VARCHAR(200) NULL DEFAULT NULL;

and

ALTER TABLE wp_matomo_log_link_visit_action ADD COLUMN custom_var_k1 VARCHAR(200) NULL DEFAULT NULL;
ALTER TABLE wp_matomo_log_conversion ADD COLUMN custom_var_v1 VARCHAR(200) NULL DEFAULT NULL;

@githubyouser
Copy link

I have a similar problem, documented here: https://forum.matomo.org/t/matomo-migration-error-the-following-columns-are-missing-in-the-target-db-table/42184/

I don't necessarily want those (empty?) columns in there if they're not needed/deprecated. Is there a way to skip those columns when migrating?

Also, it might be helpful to add a hint to users in the instructions at https://plugins.matomo.org/Migration that if they get a The following columns are missing error, to look at this issue. It took me a LOT of research and time to figure out why my migration was failing. :(

@krejcir
Copy link

krejcir commented Oct 29, 2021

I've hit very similar problem, migration plugin complains that some columns missing. It took me a while to realize that this is caused by the different plugins installed. So the message:

Please make sure both Matomo instances are on the same version

is a bit confusing, because to have the same version of Matomo is not enough. You must have also the same version of plugins (at least those that change the database schema).

And even if I have the same plugins I can't reach the same schema, maybe because there were some historical version of one of the plugins, but I'm not sure right now.

It would be very very helpful to change the exception message to something that notice users to check out the plugins too. This tiny upgrade might help a lot.

@tsteur
Copy link
Member

tsteur commented Oct 31, 2021

Thanks for the suggestion @krejcir created #36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants