plugin-SiteMigration icon indicating copy to clipboard operation
plugin-SiteMigration copied to clipboard

Migration fails on InvalidArgumentException

Open monty241 opened this issue 9 years ago • 2 comments

Using SiteMigrator (trunk version) we've encountered the error below. It is not possible to skip the failed record(s) using a skip-conversion-items option or so. Since it is a large site, we already had to split it across multiple date ranges, loading it into different sites on the other end and then update the database, such as:

./console migration:site 2 --db-prefix=piwik_ --db-host=somehwere.com --db-username=someone --db-name=piwik --skip-archive-data --verbose --db-password='something' --date-from=2013-01-01 --date-to=2014-01-01

Suggested change:

  • Allow migration to continue even when some records fail, for instance up to maximum 1% or 1.000 or alike.

...
INFO [2016-02-14 12:10:06] Migrating log data - conversions and conversion items

  [InvalidArgumentException]
  Id 2453741 not found in Piwik\Plugins\SiteMigration\Migrator\TableMigrator

Exception trace:
 () at /srv/www/htdocs/secret.com/html/plugins/SiteMigration/Migrator/TableMigrator.php:70
 Piwik\Plugins\SiteMigration\Migrator\TableMigrator->getNewId() at /srv/www/htdocs/secret.com/html/plugins/SiteMigration/Migrator/ConversionMigrator.php:59
 Piwik\Plugins\SiteMigration\Migrator\ConversionMigrator->translateRow() at /srv/www/htdocs/secret.com/html/plugins/SiteMigration/Migrator/TableMigrator.php:54
 Piwik\Plugins\SiteMigration\Migrator\TableMigrator->processRow() at /srv/www/htdocs/secret.com/html/plugins/SiteMigration/Migrator/TableMigrator.php:47
 Piwik\Plugins\SiteMigration\Migrator\TableMigrator->migrate() at /srv/www/htdocs/secret.com/html/plugins/SiteMigration/Migrator/Migrator.php:204
 Piwik\Plugins\SiteMigration\Migrator\Migrator->migrateLogVisitConversions() at /srv/www/htdocs/secret.com/html/plugins/SiteMigration/Migrator/Migrator.php:114
 Piwik\Plugins\SiteMigration\Migrator\Migrator->migrate() at /srv/www/htdocs/secret.com/html/plugins/SiteMigration/Commands/MigrateSite.php:98
 Piwik\Plugins\SiteMigration\Commands\{closure}() at /srv/www/htdocs/secret.com/html/core/Piwik.php:758
 Piwik\Piwik::doAsSuperUser() at /srv/www/htdocs/secret.com/html/plugins/SiteMigration/Commands/MigrateSite.php:104
 Piwik\Plugins\SiteMigration\Commands\MigrateSite->execute() at /srv/www/htdocs/secret.com/html/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
 Symfony\Component\Console\Command\Command->run() at /srv/www/htdocs/secret.com/html/vendor/symfony/console/Symfony/Component/Console/Application.php:874
 Symfony\Component\Console\Application->doRunCommand() at /srv/www/htdocs/secret.com/html/vendor/symfony/console/Symfony/Component/Console/Application.php:195
 Symfony\Component\Console\Application->doRun() at n/a:n/a
 call_user_func() at /srv/www/htdocs/secret.com/html/core/Console.php:79
 Piwik\{closure}() at /srv/www/htdocs/secret.com/html/core/Access.php:466
 Piwik\Access::doAsSuperUser() at /srv/www/htdocs/secret.com/html/core/Console.php:80
 Piwik\Console->doRun() at /srv/www/htdocs/secret.com/html/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at /srv/www/htdocs/secret.com/html/console:27

monty241 avatar Feb 14 '16 12:02 monty241

Hi @monty241 - thanks for the report. Pull Request to address this issue would be welcome! :+1:

mattab avatar Mar 15 '16 03:03 mattab

any update on this?

gfernandez83 avatar Aug 09 '16 06:08 gfernandez83