The user_relationships_migrate plugin anticipates that it may run out of memory or execution time, or otherwise fail, and it therefore writes a checkpoint variable after every row it adds to the user_relationships table. It attempts to ensure that the write to the user_relationships table and the storing of the variable either both happen or neither happen by wrapping them in a transaction. However, the transaction mechanism appears to not work in all cases, e.g. when the migration fails due to php execution time. Because drupal stores variables by deleting the old value and then reinserting the new value, it's possible that process might end between those two steps, and the checkpoint variable might therefore disappear completely. If you attempt to reset and restart the migration after the variable has disappeared, you'll basically restart the migration from the very beginning, possibly resulting in a great deal of duplicate data.

Your best chance of success is to make sure the script doesn't fail at all by setting your php execution time and memory limits ridiculously high prior to starting the migration, and resetting them after it succeeds. If it does fail in the middle, prior to restarting it's vital that you check the 'user_relationship_migrate_checkpoint' variable to ensure that it's set and has the proper values, or else you could end up with duplicate data in your user_relationships table.

Comments

sprsquish’s picture

Status: Active » Fixed
sprsquish’s picture

Status: Fixed » Closed (fixed)