0

I done a migration of a website, but new content were created during I done that. So how can I refresh default migrations created by the drush command :

drush @alias  migrate-upgrade --legacy-db-url=mysql://user:pass@localhost/d6ce --legacy-root=http://d6-site.vmdev --configure-only 

I know about the update option for drush mim "migration" but here, I need to recreate migration. Perhaps I just need to re-run the original command ?

Thanks

EDIT: the way seem to be:

- drush @alias mr "migration_name"(rollback migration)
 - drush @alias mrs "migration_name"(set to Idle)
 - drush @alias migrate-upgrade XXX (re-create migration)

EDIT2: I get an error on a content type:

Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '591' for key 'node__vid': INSERT   [error]
INTO {node} (nid, vid, type, uuid, langcode) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3,
:db_insert_placeholder_4); Array
(
    [:db_insert_placeholder_0] => 494
    [:db_insert_placeholder_1] => 591
    [:db_insert_placeholder_2] => page_europe
    [:db_insert_placeholder_3] => 95cc248e-6c93-4cfa-ad29-b19db86425c5
    [:db_insert_placeholder_4] => fr
)
 in Drupal\Core\Database\Connection->handleQueryException() (line 683 of /var/www/drupal-8/core/lib/Drupal/Core/Database/Connection.php).
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '591' for key 'node__vid': INSERT INTO {node} (nid, vid, type, uuid, langcode) VALUES           [error]
(:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array
(
    [:db_insert_placeholder_0] => 494
    [:db_insert_placeholder_1] => 591
    [:db_insert_placeholder_2] => page_europe
    [:db_insert_placeholder_3] => 95cc248e-6c93-4cfa-ad29-b19db86425c5
    [:db_insert_placeholder_4] => fr
)
 (/var/www/drupal-8/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php:783)
Processed 31 items (30 created, 0 updated, 1 failed, 0 ignored) - done with 'd6_node:page_europe'                                                                     [status]
d6_node:page_europe Migration - 1 failed.      

With or without roolback...no issue on another content type.Related to taxonomy ? How can I fix that ? I notify that if I just run: drush @alias ms I get this kind of infos:

upgrade_d6_file      Idle  1521   1497      21         2018-10-29 14:57:40

So new files are mentionned and would be able to be imported as is with --update option ,not ?

1

I needed something similar, I solved it by first making a rollback and then I launched the original command.

drush mr

You can find more information about the command on this link https://drushcommands.com/drush-8x/migrate/migrate-rollback/

  • I thought about this and I see this is the best way to do. After test it on a migration, new content doesn't appear after I launched drush mr, drush mrs and drush migrate-upgrade commands..Will see in the future if it work. – webmaster pf Nov 12 '18 at 14:33
  • drush @alias migrate-upgrade XXX doesn't update the migration..perhaps clearing cache is needed before recreate migrations with migrate-upgrade ? – webmaster pf Dec 3 '18 at 10:11

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.