Closed urbantrout closed 6 years ago
@urbantrout what type of data are attempting to migrate? Looks like it might be global fields? Is it just fields or content?
Sorry for the late reply!
This particular migration only consists of global fields.
@urbantrout is this issue with global migrations still happening. Tested locally and all is good.
@dgrigg I'm having kind of the same issue with a migration where i'm adding a field to existing globals.
Exception: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '15-1' for key 'craft_content_elementId_siteId_unq_idx'
The SQL being executed was: UPDATE `craft_content` SET `elementId`=15, `siteId`=1, `dateUpdated`='2018-10-22 09:27:37' WHERE `id`='15' (/var/www/vendor/yiisoft/yii2/db/Schema.php:664)
#0 /var/www/vendor/yiisoft/yii2/db/Command.php(1263): yii\db\Schema->convertException(Object(PDOException), 'UPDATE `craft_c...')
#1 /var/www/vendor/yiisoft/yii2/db/Command.php(1075): yii\db\Command->internalExecute('UPDATE `craft_c...')
#2 /var/www/vendor/craftcms/cms/src/services/Content.php(191): yii\db\Command->execute()
#3 /var/www/vendor/craftcms/cms/src/services/Elements.php(486): craft\services\Content->saveContent(Object(craft\elements\GlobalSet))
#4 /var/www/vendor/craftcms/cms/src/services/Globals.php(354): craft\services\Elements->saveElement(Object(craft\elements\GlobalSet), false)
#5 /var/www/vendor/firstborn/migrationmanager/src/services/Globals.php(76): craft\services\Globals->saveSet(Object(craft\elements\GlobalSet))
#6 /var/www/vendor/firstborn/migrationmanager/src/services/BaseMigration.php(147): firstborn\migrationmanager\services\Globals->importItem(Array)
#7 /var/www/vendor/firstborn/migrationmanager/src/services/Migrations.php(264): firstborn\migrationmanager\services\BaseMigration->import(Array)
#8 /var/www/migrations/m181022_104022_migration_AddedLogoFields.php(40): firstborn\migrationmanager\services\Migrations->import(Array)
#9 /var/www/vendor/craftcms/cms/src/db/Migration.php(56): craft\contentmigrations\m181022_104022_migration_AddedLogoFields->safeUp()
#10 /var/www/vendor/craftcms/cms/src/db/MigrationManager.php(243): craft\db\Migration->up(true)
#11 /var/www/vendor/craftcms/cms/src/db/MigrationManager.php(163): craft\db\MigrationManager->migrateUp(Object(craft\contentmigrations\m181022_104022_migration_AddedLogoFields))
#12 /var/www/vendor/craftcms/cms/src/services/Updates.php(210): craft\db\MigrationManager->up()
#13 /var/www/vendor/craftcms/cms/src/console/controllers/MigrateController.php(243): craft\services\Updates->runMigrations(Array)
#14 [internal function]: craft\console\controllers\MigrateController->actionAll()
#15 /var/www/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#16 /var/www/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#17 /var/www/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('all', Array)
#18 /var/www/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('all', Array)
#19 /var/www/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate/all', Array)
#20 /var/www/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('migrate/all', Array)
#21 /var/www/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(craft\console\Request))
#22 /var/www/craft(23): yii\base\Application->run()
#23 {main}
Exception 'craft\errors\MigrateException' with message 'An error occurred while migrating Craft CMS.'
in /var/www/vendor/craftcms/cms/src/services/Updates.php:223
@roelvanhintum thanks for the PR, all good
I am trying to run a migration. The migration was created on the production server and copied to my local dev server.
Setup
Live server
Dev server
Exceptions
Whenever I try to run the migration I get the following Internal Server Error:
And on some other migrations I only get this, which does not provide any useful hints (at least for me)