Closed (fixed)
Project:
Migrate Extras
Version:
7.x-2.5
Component:
Flag
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
25 Sep 2012 at 14:32 UTC
Updated:
2 Feb 2016 at 18:28 UTC
Jump to comment: Most recent
Comments
Comment #1
emjayess commented+1 we're facing this as well - and searching high and low for examples using the flag support in migrate extras to migrate flag content. any example or direction would help...
thanks in advance!
Comment #2
hbalagtas commented@emjayess I couldn't wait for help anymore so I decided to just manually migrate the flags during the user migration, it might not be the best or fastest way but it worked for me, hope this helps you out.
Basically created a user query that also fetches their favorites
Then using the complete function
Comment #3
mikeryanSorry I didn't respond in time to help. I vaguely recall using the flag support on one project, but can't track down the code. It looks to me, though, like it should just be a matter of mapping to the flag name. If you have flags attached to users, in the Migrate UI if you click on the name of your user migration, the flags should be exposed as destination fields, and you should be able to do this in your constructor:
Comment #5
luukyb commentedHi,
I was looking for some documentation too, but there isn't anywhere.
I tried to do the solution in #3 with using the function complete or post import. But if you have too much data to migrate, your system will soon run out of memory.
Then the only way is to use this module and create a separate class, like if you were migrating nodes or users.
In your class, start to declare your flag
Then the destination class you will have to use is MigrateDestinationFlagSimple. In your MigrateSQLMap:
And in your destination:
Destination fields are from the table flag_content in your drupal db. Like : fid, content_type, content_id, uid.
Once you have prepared the right data (from your query or PrepareRow), simply map it like:
Hope that can help someone :)
Luc
Comment #6
mccrodp commentedHi,
I tried Mike's method, but from within migrate_d2d module, but to no avail and I cannot see anything flag related to the User migration in terms of source/destination fields. I have my User migration all working with migrate_d2d module, so don't want to change to this module. However I separated out my flag content migrate module and I'm getting a
'Fatal error: Class 'MigrateDestinationFlagSimple' not found in flag.inc' error.Am I extending the wrong class or do I specifically need to include / register MigrateDestinationFlagSimple class somewhere?Many thanks.
Comment #7
travelerttSee https://www.drupal.org/node/1995566#comment-7929027
Comment #8
jcandan commentedThis is being ported to the Flag module and is currently a work in progress. See https://www.drupal.org/node/2503815
Comment #9
jcandan commented