AnswerBun.com

Specify which Migrate entries need to be updated using prepareRow

Drupal Answers Asked by blablazo on November 8, 2021

I have made a Migration that i run with Cron. My highwater field is the date changed, which is present in the XML (source) document. Then I do this in my cron function:

 $result = $migration->prepareUpdate();
 $result = $migration->processImport();

Problem is is this will update ALL nodes from the XML. I would like to only update those that have been changed, according to their modifiedAt date. If I just do:

 $result = $migration->processImport();

Then nothing at all updates. I think processImport() would work if it were just about importing new items, but I also need to update any existing items that have changed. The ones that don’t need updating can be skipped, of course. Is there another method I could call here? Is there a way I need to set up some kind of prepareRow to mark items as needing updating?

One Answer

The recommended way to do what you are trying to do is with drush. Is drush available to you? if so have cron execute a drush mi command. See https://drupal.org/node/1561820. Also make sure your highwater mark is set up correctly. See https://drupal.org/node/1223936.

Answered by pferlito on November 8, 2021

Add your own answers!

Related Questions

Ajax callback does not replace the form but add a new field

1  Asked on January 6, 2022 by billyjoe

 

How to change search placeholder?

1  Asked on January 6, 2022 by tritof

       

Using computed field value in Rules

2  Asked on January 4, 2022

     

Unable to save content language configuration

2  Asked on January 4, 2022 by philipp-michael

     

Workbench: How can I reorder display of Workbench Tabs?

1  Asked on January 2, 2022 by cocoskin

 

Getting the image URL from a field_image on a node

16  Asked on January 2, 2022 by rias

   

Drupal 8 CKEeditor license/pricing

1  Asked on January 2, 2022 by donquixote

   

Retain Guzzle Session During Batch Operations

1  Asked on January 2, 2022 by tyler-frankenstein

   

Fatal error while editing and deleting menu items

1  Asked on December 31, 2021 by ashutoshsngh

   

Field collection item not visible to anonymous user

1  Asked on December 28, 2021 by kevindeleon

 

Get Checkbox Value From Another Form

1  Asked on December 28, 2021

   

How do I change the uploading image file name

1  Asked on December 28, 2021 by i-am-batman

     

get value from content type B, in a view of content type A

1  Asked on December 28, 2021 by bapafe

   

Twig Template print field – if not node number

1  Asked on December 28, 2021 by juc1

 

Ask a Question

Get help from others!

© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP