I'm extremely grateful for the boost this module gave me writing 40 migrations for a complex d6-d7 upgrade/rationalisation. However it did stump me for a while that I couldn't prevent updates when I was running subsequent imports. I only wanted to import new content, and I ensured "needs_update" was set to 0 and I couldn't understand why updates were still occurring without the flags set. I finally tracked the problem to the highwaterField settings for each d2d migration. While this field is set updates cannot be prevented. I feel the setting of these fields if they want them should be left to the user, not included in the d2d migrations, or perhaps their use could be a configuration setting?

Comments

helmo’s picture

I found that after modifying some field mappings I had to remove the highwater field for node to be able to run an update.
So +1 for making this configurable.

In the constructor of class DrupalNodeMigration I set:

$this->highwaterField = array();

mikeryan’s picture

Acknowledged, we should add a 'suppress_highwater' argument or somesuch. In the meantime, as helmo demonstrates, you can override the class and disable it yourself.

amberau79’s picture

Yes, thanks, I did override the class. I guess this could also be fixed by making it clear in the documentation for d2d that the highwater fields are part of the design. It wasn't hard to fix, but it was hard to work out what was causing the unexpected behaviour.

mikeryan’s picture

Status: Active » Fixed

Committed - you can now set the "add_only" argument to 1 (TRUE) to suppress updates based on either highwater mark or (in the case of users) track_changes.

amberau79’s picture

Nice work :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dafeder’s picture

Status: Closed (fixed) » Active

Apologies if re-opening this turns out not to have been appropriate. I still don't see a way to suppress highwater marks completely. For instance, I am writing a d62d7 file migration. There is a fair amount of trial and error, so I'd like to be able to re-run the migration as many times as I need to and update ALL the previously imported files. I've tried every combination of new_only and add_only arguments and I can still never re-migrate files that imported wrong or failed. Only by adding $this->highwaterField = array(); to DrupalFile6Migration can I import my files. I guess I can write a new custom file migration class but it seems like this is someting you should be able to take care of in the .module file.

mikeryan’s picture

Issue summary: View changes
Status: Active » Closed (fixed)

The argument ended up being "new_only", not "add_only" as stated above. So, in the arguments for your file migration, you should have $arguments['new_only'] == TRUE.

Going forward, please open a separate support issue, do not reopen a closed issue.