I an using drush to update yamlforms on a site hosted on Pantheon and got the following error to a 'drush yamlform-to-webform-migrate':

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062      [error]
Duplicate entry 'core.base_field_override.node.webform.promote' for
key 'PRIMARY' in
/srv/bindings/9913a47ecb444d9c8cfaea0db945a700/code/core/lib/Drupal/Core/Database/Statement.php:59
Stack trace:
#0
/srv/bindings/9913a47ecb444d9c8cfaea0db945a700/code/core/lib/Drupal/Core/Database/Statement.php(59):
PDOStatement->execute(Array)
#1
/srv/bindings/9913a47ecb444d9c8cfaea0db945a700/code/core/lib/Drupal/Core/Database/Connection.php(610):
Drupal\Core\Database\Statement->execute(Array, Array)
#2
/srv/bindings/9913a47ecb444d9c8cfaea0db945a700/code/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php(81):
Drupal\Core\Database\Connection->query('UPDATE config S...', Array,
Array)
#3
/srv/bindings/9913a47ecb444d9c8cfaea0db945a700/code/modules/contrib/yamlform/modules/yamlform_to_webform/src/YamlFormToWebformMigrateManager.php(359):
Drupal\Core\Database\Driver\mysql\Connection->query('UPDATE config
S...')
#4
/srv/bindings/9913a47ecb444d9c8cfaea0db945a700/code/modules/contrib/yamlform/modules/yamlform_to_webform/src/YamlFormToWebformMigrateManager.php(228):
Drupal\yamlform_to_webform\YamlFormToWebformMigrateManager->renameColumns('config')
#5
/srv/bindings/9913a47ecb444d9c8cfaea0db945a700/code/modules/contrib/yamlform/modules/yamlform_to_webform/yamlform_to_webform.drush.inc(68):
Drupal\yamlform_to_webform\YamlFormToWebformMigrateManager->migrate()
#6 /opt/pantheon/drush-8/includes/command.inc(373):
drush_yamlform_to_webform_migrate()
#7 /opt/pantheon/drush-8/includes/command.inc(224):
_drush_invoke_hooks(Array, Array)
#8 /opt/pantheon/drush-8/includes/command.inc(192): drush_command()
#9 /opt/pantheon/drush-8/lib/Drush/Boot/BaseBoot.php(67):
drush_dispatch(Array)
#10 /opt/pantheon/drush-8/includes/preflight.inc(66):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#11 /opt/pantheon/drush-8/drush.php(12): drush_main()
#12 {main}

Next Drupal\Core\Database\IntegrityConstraintViolationException:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
'core.base_field_override.node.webform.promote' for key 'PRIMARY':
UPDATE config SET name = REPLACE(name, 'yamlform', 'webform'); Array
(
)
 in
/srv/bindings/9913a47ecb444d9c8cfaea0db945a700/code/core/lib/Drupal/Core/Database/Connection.php:668
Stack trace:
#0
/srv/bindings/9913a47ecb444d9c8cfaea0db945a700/code/core/lib/Drupal/Core/Database/Connection.php(635):
Drupal\Core\Database\Connection->handleQueryException(Object(PDOException),
'UPDATE config S...', Array, Array)
#1
/srv/bindings/9913a47ecb444d9c8cfaea0db945a700/code/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php(81):
Drupal\Core\Database\Connection->query('UPDATE config S...', Array,
Array)
#2
/srv/bindings/9913a47ecb444d9c8cfaea0db945a700/code/modules/contrib/yamlform/modules/yamlform_to_webform/src/YamlFormToWebformMigrateManager.php(359):
Drupal\Core\Database\Driver\mysql\Connection->query('UPDATE config
S...')
#3
/srv/bindings/9913a47ecb444d9c8cfaea0db945a700/code/modules/contrib/yamlform/modules/yamlform_to_webform/src/YamlFormToWebformMigrateManager.php(228):
Drupal\yamlform_to_webform\YamlFormToWebformMigrateManager->renameColumns('config')
#4
/srv/bindings/9913a47ecb444d9c8cfaea0db945a700/code/modules/contrib/yamlform/modules/yamlform_to_webform/yamlform_to_webform.drush.inc(68):
Drupal\yamlform_to_webform\YamlFormToWebformMigrateManager->migrate()
#5 /opt/pantheon/drush-8/includes/command.inc(373):
drush_yamlform_to_webform_migrate()
#6 /opt/pantheon/drush-8/includes/command.inc(224):
_drush_invoke_hooks(Array, Array)
#7 /opt/pantheon/drush-8/includes/command.inc(192): drush_command()
#8 /opt/pantheon/drush-8/lib/Drush/Boot/BaseBoot.php(67):
drush_dispatch(Array)
#9 /opt/pantheon/drush-8/includes/preflight.inc(66):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#10 /opt/pantheon/drush-8/drush.php(12): drush_main()
#11 {main}

Still investigating the cause but it looks like it tried to rename the same entry twice or I have multiple yamlform entries with the same name which shouldn't be possible.

Comments

Dippers created an issue. See original summary.

jrockowitz’s picture

Did you install and then uninstall the Webform module before the migration?

Dippers’s picture

No, the webform module was present but never enabled.

I think I figured out the problem. Because this was a d6 to d8 migration the d6 webform content type had been migrated as a basic content type and then the yamlform migration added the forms and linked them to the relevant webform nodes. So the d8 build already had an existing webform content type from the d6 migration which is why when I tried the yamlform to webform migrate it clashed with the existing content type.

Not sure where I go now, probably back to square one and run the d6 to d8 migration again this time using a webform migration instead of the yamlform migration.

jrockowitz’s picture

Status: Active » Closed (outdated)