How does migrate update work?

If you use Migrate Tools to start an import with the --update flag, it will update previously imported items.

MigrateToolsCommands provides the migrate drush commands.

The import() function instantiates and calls executeMigration().

If the update flag is set, it will check if --idlist is also set and if not, call $migration->getIdMap->prepareUpdate().

The default plugin, Sql, uses database tables to store the migration map and messages.

Sql->prepareUpdate() sets source_row_status for all items in the migrate map table to MigrateIdMapInterface::STATUS_NEEDS_UPDATE (1).

If --idlist is used, call $migration->getIdMap()->setUpdate() to mark them in the migration map table as needs update.

Tags