PiwikPRO / plugin-SiteMigration

Migrate websites and website data between two Piwik installations
17 stars 3 forks source link

Unknown column 'location_provider' in 'field list' #36

Closed NicolasGoeddel closed 8 years ago

NicolasGoeddel commented 8 years ago

Hi, I am trying to migrate a single site from one Piwik installation to an other using your plugin. Both Piwiks are running in version 2.16.0. The difference is the the PHP and MySQL version: Server 1: PHP 5.4.39 and MySQL 5.1.73 Server 2: PHP 5.5.9 and MySQL 5.5.7 On both Piwiks the same addons are installed. On server 1 also SiteMigration is installed.

This is the error output:

www-data@h1980054:~/sites/piwik$ ./console migration:site -vvv 20
Please provide the destination database host [localhost]: mysite.com
Please provide the destination database username: piwik
Please provide the destination database password: 
Please provide the destination database name: piwik
INFO [2016-03-09 13:29:08] Start transaction
INFO [2016-03-09 13:29:08] Migrating site config
INFO [2016-03-09 13:29:09] Loading existing actions
INFO [2016-03-09 13:29:09] Migrating log data - visits

  [Zend_Db_Statement_Mysqli_Exception]                                      
  Mysqli prepare error: Unknown column 'location_provider' in 'field list'  

Exception trace:
 () at /var/www/sites/piwik/libs/Zend/Db/Statement/Mysqli.php:77
 Zend_Db_Statement_Mysqli->_prepare() at /var/www/sites/piwik/libs/Zend/Db/Statement.php:115
 Zend_Db_Statement->__construct() at /var/www/sites/piwik/libs/Zend/Db/Adapter/Mysqli.php:381
 Zend_Db_Adapter_Mysqli->prepare() at /var/www/sites/piwik/libs/Zend/Db/Adapter/Abstract.php:478
 Zend_Db_Adapter_Abstract->query() at /var/www/sites/piwik/libs/Zend/Db/Adapter/Abstract.php:575
 Zend_Db_Adapter_Abstract->insert() at /var/www/sites/piwik/plugins/SiteMigration/Helper/DBHelper.php:43
 Piwik\Plugins\SiteMigration\Helper\DBHelper->executeInsert() at /var/www/sites/piwik/plugins/SiteMigration/Migrator/TableMigrator.php:56
 Piwik\Plugins\SiteMigration\Migrator\TableMigrator->processRow() at /var/www/sites/piwik/plugins/SiteMigration/Migrator/TableMigrator.php:47
 Piwik\Plugins\SiteMigration\Migrator\TableMigrator->migrate() at /var/www/sites/piwik/plugins/SiteMigration/Migrator/Migrator.php:182
 Piwik\Plugins\SiteMigration\Migrator\Migrator->migrateLogVisits() at /var/www/sites/piwik/plugins/SiteMigration/Migrator/Migrator.php:112
 Piwik\Plugins\SiteMigration\Migrator\Migrator->migrate() at /var/www/sites/piwik/plugins/SiteMigration/Commands/MigrateSite.php:98
 Piwik\Plugins\SiteMigration\Commands\MigrateSite->Piwik\Plugins\SiteMigration\Commands\{closure}() at /var/www/sites/piwik/core/Piwik.php:758
 Piwik\Piwik::doAsSuperUser() at /var/www/sites/piwik/plugins/SiteMigration/Commands/MigrateSite.php:104
 Piwik\Plugins\SiteMigration\Commands\MigrateSite->execute() at /var/www/sites/piwik/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
 Symfony\Component\Console\Command\Command->run() at /var/www/sites/piwik/vendor/symfony/console/Symfony/Component/Console/Application.php:874
 Symfony\Component\Console\Application->doRunCommand() at /var/www/sites/piwik/vendor/symfony/console/Symfony/Component/Console/Application.php:195
 Symfony\Component\Console\Application->doRun() at n/a:n/a
 call_user_func() at /var/www/sites/piwik/core/Console.php:79
 Piwik\Console->Piwik\{closure}() at /var/www/sites/piwik/core/Access.php:466
 Piwik\Access::doAsSuperUser() at /var/www/sites/piwik/core/Console.php:80
 Piwik\Console->doRun() at /var/www/sites/piwik/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at /var/www/sites/piwik/console:27

migration:site [--skip-archive-data] [--skip-log-data] [-H|--db-host="..."] [-U|--db-username="..."] [-P|--db-password="..."] [-N|--db-name="..."] [--db-prefix[="..."]] [--db-port="..."] [-F|--date-from="..."] [-T|--date-to="..."] idSite
NicolasGoeddel commented 8 years ago

It seems that the field 'location_provider' is a member of the table 'log_visit' on Server 1 but not on Server 2. I solved the issue with that SQL query on the destination site:

alter table log_visit add column location_provider varchar(100) null after custom_var_v5;
mattab commented 8 years ago

Thanks for the report. Marking as duplicate of other similar issue: https://github.com/PiwikPRO/plugin-SiteMigration/issues/30

cl-luka commented 7 years ago

Hi,

we had the same problem while migrating Piwik-data and it's not a plugin that is missing, it's a core plugin that has to be activated, that caused this error: Provider (Core) Reports the Internet Service Provider of the visitors.